|
@@ -1,7 +1,10 @@
|
1
|
1
|
#!/bin/bash
|
2
|
2
|
|
|
3
|
+# initialize cookie store
|
|
4
|
+cp /dev/null cookies.txt
|
|
5
|
+
|
3
|
6
|
# login and store cookies in 'cookies.txt' AND retrieve the value of the XSRF token
|
4
|
|
-TOKEN=`curl 'http://localhost/api.php/' --data "username=admin&password=admin" --cookie-jar cookies.txt`
|
|
7
|
+TOKEN=`curl 'http://localhost/api.php/' --data "username=admin&password=admin" --cookie-jar cookies.txt --silent`
|
5
|
8
|
|
6
|
9
|
# strip the double quotes from the variable (JSON decode)
|
7
|
10
|
TOKEN=${TOKEN//\"/}
|