Browse Source

test script for inserting information

nas 3 years ago
parent
commit
518a6c4d7f
1 changed files with 31 additions and 0 deletions
  1. 31
    0
      test/post_line.sh

+ 31
- 0
test/post_line.sh View File

@@ -0,0 +1,31 @@
1
+#/bin/sh
2
+
3
+help() {
4
+    echo "Syntaxe"
5
+    echo "‾‾‾‾‾‾‾"
6
+    echo "sh $0 [ adresse ] [ username ] [ password ]\n"
7
+}
8
+
9
+if [ -z "$1" ]
10
+then
11
+    echo "Missing parameters : web adresses is needed\n"
12
+    help
13
+    exit
14
+fi
15
+if [ -z "$2" ]
16
+then
17
+    echo "Missing parameters : tablename is needed\n"
18
+    help
19
+    exit
20
+fi
21
+if [ -z "$3" ]
22
+then
23
+    echo "Missing parameters : data are needed\n"
24
+    help
25
+    exit
26
+fi
27
+
28
+echo "Get id $3 of table $2"
29
+echo "$1 $2 $3"
30
+curl --header "Content-Type: application/json" -b cookie.txt --data "$3" $1/api.php/records/$2/
31
+echo "\n"

Loading…
Cancel
Save