18 lines
307 B
Bash
18 lines
307 B
Bash
|
#!/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}"
|