1
0
James Ketrenos 32aedaa6ca Pull admin token from config
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
2022-01-28 14:39:13 -08:00

23 lines
502 B
Bash
Executable File

#!/bin/bash
ADMIN=$(jq .admin config/local.json)
if [[ "${ADMIN}" == "" ]]; then
echo "You need to set your { 'admin': 'secret' } in config/local.json"
exit 1
fi
id=$1
user=$2
if [[ "${id}" == "" ]] || [[ "${user}" == "" ]]; then
echo "Usage: kick GAME-ID USER-NAME"
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}/kick/${user} |
jq .status