summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rwxr-xr-xbuild17
1 files changed, 15 insertions, 2 deletions
diff --git a/build b/build
index d080658..d4f92c1 100755
--- a/build
+++ b/build
@@ -1,4 +1,17 @@
#!/bin/sh
-curl -X POST -H "Content-Type: application/json" http://localhost:9000/api/submit \
- -d "{\"url\": \"$1\"}"
+case "$1" in
+ start)
+ shift
+ curl -i -X POST -H "Content-Type: application/json" "http://localhost:9000/api/submit" \
+ -d "{\"url\": \"$1\"}"
+ ;;
+ cancel)
+ shift
+ curl -i -X POST "http://localhost:9000/api/$1/cancel"
+ ;;
+ *)
+ echo "invalid command $1" >&2
+ exit 2
+ ;;
+esac