Advertisement
Guest User

Untitled

a guest
Jul 26th, 2011
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.10 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. USERNAME=mcantor
  4. JIRA_URL=http://jira.dimpledough.com
  5. COOKIES=cookies.txt
  6. HEADER='X-Atlassian-Token: no-check'
  7.  
  8. SUPPORT=10131
  9.  
  10. if [[ "$1" == "login" ]]; then
  11.     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
  12. elif [[ "$1" == "websudo" ]]; then
  13.     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"
  14. elif [[ "$1" == "api" ]]; then
  15.     curl -s -b "$COOKIES" -H "$HEADER" $JIRA_URL/rest/api/2.0.alpha1/$2; echo
  16. elif [[ "$1" == "comp-proj" ]]; then
  17.     # Add a component for each project that exists.
  18.     while read -r line
  19.     do
  20.     PROJ=$line
  21.     echo "Adding $PROJ..."
  22.     curl -s -b "$COOKIES" -H "$HEADER" -d "pid=$SUPPORT" -d "name=$PROJ" $JIRA_URL/secure/project/AddComponent.jspa
  23.     done < "projects"
  24. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement