Browse Source

add a script to get a line from the table name ant its id

nas 3 years ago
parent
commit
0e00b9f191
1 changed files with 9 additions and 2 deletions
  1. 9
    2
      test/get_line.sh

+ 9
- 2
test/get_line.sh View File

@@ -18,7 +18,14 @@ then
18 18
     help
19 19
     exit
20 20
 fi
21
-echo "Login as $2 in cookie.txt"
21
+if [ -z "$3" ]
22
+then
23
+    echo "Missing parameters : an id is needed\n"
24
+    help
25
+    exit
26
+fi
27
+
28
+echo "Get id $3 of table $2"
22 29
 echo "$1 $2 $3"
23
-curl --header "Content-Type: application/json" -b cookie.txt $1/api.php/records/$2
30
+curl --header "Content-Type: application/json" -b cookie.txt $1/api.php/records/$2/$3
24 31
 echo "\n"

Loading…
Cancel
Save