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 536B

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