-
Notifications
You must be signed in to change notification settings - Fork 11
/
clientquery.sh
executable file
·24 lines (22 loc) · 773 Bytes
/
clientquery.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
# This script lets you easily test ts3 clientquery commands on your musicbot system.
printf "Enter TeamSpeak ClientQuery API key (defaults to whatever is in ~/.ts3client/clientquery.ini): "
read -r API_KEY
if [ -z "$API_KEY" ]; then
CLIENTQUERY_FILE="$HOME/.ts3client/clientquery.ini"
API_KEY="$(grep api_key "$CLIENTQUERY_FILE" | cut -d= -f2)"
fi
printf "Enter teamspeak client address (defaults to localhost): "
read -r TS_ADDRESS
if [ -z "$TS_ADDRESS" ]; then
TS_ADDRESS="localhost"
fi
while true; do
printf "Enter teamspeak command: "
read -r TS_COMMAND
if [ "$TS_COMMAND" != "exit" ] && [ "$TS_COMMAND" != "quit" ]; then
(echo "auth apikey=$API_KEY"; echo "$TS_COMMAND"; echo quit) | nc "$TS_ADDRESS" 25639; echo
else
break
fi
done