Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- USERNAME=mcantor
- JIRA_URL=http://jira.dimpledough.com
- COOKIES=cookies.txt
- HEADER='X-Atlassian-Token: no-check'
- SUPPORT=10131
- if [[ "$1" == "login" ]]; then
- curl -s -c "$COOKIES" -H "$HEADER" -d "os_username=$USERNAME" -d "os_password=$(read -s -p "Password: " pass && echo $pass)" -d "os_cookie=true" $JIRA_URL/login.jsp > /dev/null
- elif [[ "$1" == "websudo" ]]; then
- curl -si -c "$COOKIES" -b "$COOKIES" -H "$HEADER" -d "webSudoPassword=$(read -s -p "Password: " pass && echo $pass)" -d "os_cookie=true" -d "webSudoDestination=/secure/admin/ViewWorkflowSchemes.jspa" -d "webSudoIsPost=false" -d "authenticate=Confirm" $JIRA_URL/secure/admin/WebSudoAuthenticate.jspa | grep "WebSudo"
- elif [[ "$1" == "api" ]]; then
- curl -s -b "$COOKIES" -H "$HEADER" $JIRA_URL/rest/api/2.0.alpha1/$2; echo
- elif [[ "$1" == "comp-proj" ]]; then
- # Add a component for each project that exists.
- while read -r line
- do
- PROJ=$line
- echo "Adding $PROJ..."
- curl -s -b "$COOKIES" -H "$HEADER" -d "pid=$SUPPORT" -d "name=$PROJ" $JIRA_URL/secure/project/AddComponent.jspa
- done < "projects"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement