1
0
James Ketrenos 790317428c Added a couple helper admin scrtipt
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
2022-02-03 16:06:41 -08:00

23 lines
513 B
Bash
Executable File

#!/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