瀏覽代碼

testscript to delete line

nas 3 年之前
父節點
當前提交
e2b4ddf9a8
共有 1 個檔案被更改,包括 31 行新增0 行删除
  1. 31
    0
      test/del_line.sh

+ 31
- 0
test/del_line.sh 查看文件

@@ -0,0 +1,31 @@
1
+#/bin/sh
2
+
3
+help() {
4
+    echo "Syntaxe"
5
+    echo "‾‾‾‾‾‾‾"
6
+    echo "sh $0 [ adresse ] [ table ] [ id ]\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 : an id is needed\n"
24
+    help
25
+    exit
26
+fi
27
+
28
+echo "Delete id $3 of table $2"
29
+echo "$1 $2 $3"
30
+curl --header "Content-Type: application/json" -X "DELETE" -b cookie.txt $1/api.php/records/$2/$3
31
+echo "\n"

Loading…
取消
儲存