util to move counter up/down
This commit is contained in:
parent
25601d88e9
commit
bd7891d2fb
1 changed files with 17 additions and 0 deletions
17
utils/movecounter.sh
Executable file
17
utils/movecounter.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
queue_num="${QUEUE_NUM:-0}"
|
||||
user_password="${USER_PASSWORD}"
|
||||
host="${HOST:-http://localhost:8000}"
|
||||
|
||||
|
||||
|
||||
if [ "$1" = "+1" ]; then
|
||||
url="${host}/v1/counter/${queue_num}/increment"
|
||||
else
|
||||
url="${host}/v1/counter/${queue_num}/decrement"
|
||||
fi
|
||||
|
||||
curl -s -X POST -u "${user_password}" "${url}"
|
Loading…
Reference in a new issue