-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswitch.sh
executable file
·21 lines (18 loc) · 1.06 KB
/
switch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
cd $(dirname "$0")
while true; do
for i in xmpp.krourke.org/*\@cheogram.com/out; do
user=$(basename $(dirname "$i"))
msg=$(tail -n 1 "$i" | sed 's/.*> //')
msgcaps=$(echo "$msg" | tr 'a-z' 'A-Z')
rm -f "$i"
[[ "$msgcaps" == HELP ]] && echo "Enter NEW to start a new game. Enter START to begin a game once all players have joined. Enter a 6-digit game code to join a game. Enter an 8-digit player code when you have found a target. Enter STOP to end your game early. For more information, see: http://Assassins.TECH." > xmpp.krourke.org/$user/in && break
[[ "$msgcaps" == NEW ]] && ./onboard.sh "$user" && break
[[ "$msg" =~ ^[0-9]{6}$ ]] && ./join.sh "$user" "$msg" && break
[[ "$msg" =~ ^https://i.imgur.com/[a-zA-Z0-9]{7}.jpg$ ]] && ./image.sh "$user" "$msg" && break
[[ "$msgcaps" == START ]] && ./start.sh "$user" && break
[[ "$msg" =~ ^[0-9]{8}$ ]] && ./kill.sh "$user" "$msg" && break
[[ "$msgcaps" == STOP ]] && ./stop.sh "$user" && break
echo "I didn't understand your command. Enter HELP for help." > xmpp.krourke.org/$user/in
done
done