Added a couple helper admin scrtipt
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
357dccd130
commit
790317428c
22
server/roll
Executable file
22
server/roll
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
ADMIN=$(jq -r .admin config/local.json)
|
||||||
|
if [[ "${ADMIN}" == "" ]]; then
|
||||||
|
echo "You need to set your { 'admin': 'secret' } in config/local.json"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
id=$1
|
||||||
|
color=$2
|
||||||
|
|
||||||
|
if [[ "${id}" == "" ]] || [[ "${color}" == "" ]]; then
|
||||||
|
echo "Usage: roll GAME-ID (red|white|blue|orange)-DICE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl --noproxy '*' -s -L \
|
||||||
|
--request PUT \
|
||||||
|
--header "PRIVATE-TOKEN: ${ADMIN}" \
|
||||||
|
--header "Content-Type: application/json" \
|
||||||
|
http://localhost:8930/ketr.ketran/api/v1/games/${id}/roll/${color} |
|
||||||
|
jq -r .status
|
||||||
|
|
22
server/state
Executable file
22
server/state
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
ADMIN=$(jq -r .admin config/local.json)
|
||||||
|
if [[ "${ADMIN}" == "" ]]; then
|
||||||
|
echo "You need to set your { 'admin': 'secret' } in config/local.json"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
id=$1
|
||||||
|
state=$2
|
||||||
|
|
||||||
|
if [[ "${id}" == "" ]] || [[ "${state}" == "" ]]; then
|
||||||
|
echo "Usage: roll GAME-ID game-order"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl --noproxy '*' -s -L \
|
||||||
|
--request PUT \
|
||||||
|
--header "PRIVATE-TOKEN: ${ADMIN}" \
|
||||||
|
--header "Content-Type: application/json" \
|
||||||
|
http://localhost:8930/ketr.ketran/api/v1/games/${id}/state/${state} |
|
||||||
|
jq -r .status
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user