api de gestion de ticket, basé sur php-crud-api. Le but est de décorrélé les outils de gestion des données, afin
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

login.sh 630B

123456789101112131415161718192021222324252627282930
  1. #/bin/sh
  2. help() {
  3. echo "Syntaxe"
  4. echo "‾‾‾‾‾‾‾"
  5. echo "sh $0 [ adresse ] [ username ] [ password ]\n"
  6. }
  7. if [ -z "$1" ]
  8. then
  9. echo "Missing parameters : web adresses is needed\n"
  10. help
  11. exit
  12. fi
  13. if [ -z "$2" ]
  14. then
  15. echo "Missing parameters : username is needed\n"
  16. help
  17. exit
  18. fi
  19. if [ -z "$3" ]
  20. then
  21. echo "Missing parameters : password is needed\n"
  22. help
  23. exit
  24. fi
  25. echo "Login as $2 in cookie.txt"
  26. echo "$1 $2 $3"
  27. curl --header "Content-Type: application/json" --cookie-jar cookie.txt --request POST --data "{\"username\":\"$2\",\"password\":\"$3\"}" $1/api.php/login
  28. echo "\n"