12345678910111213141516171819202122232425262728293031 |
- #/bin/sh
-
- help() {
- echo "Syntaxe"
- echo "‾‾‾‾‾‾‾"
- echo "sh $0 [ address ] [ username ] [ password ]\n"
- }
-
- if [ "$1" ]
- then
- address=$1
- fi
- if [ -z "$2" ]
- then
- username=$2
- fi
- if [ -z "$3" ]
- then
- password=$3
- fi
-
- . ./config.sh
- . ./dep/address.sh
- . ./dep/username.sh
- . ./dep/password.sh
-
- . ./tools/title.sh
- echo "Login as $username in cookie.txt"
- result=`curl --header "Content-Type: application/json" --cookie-jar cookie.txt --request POST --data "{\"username\":\"$username\",\"password\":\"$password\"}" $address/api.php/login 2>/dev/null`
- sh tools/show_result.sh $result
- echo "\n"
|