-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·32 lines (31 loc) · 842 Bytes
/
start.sh
File metadata and controls
executable file
·32 lines (31 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
USAGE="./start.sh <gamenode> Gamemodes = SkyBlock, Prison, Lobby"
if [[ -z "$1" ]]
then
echo $USAGE
exit 1
fi
if [[ "$1" == "Prison" ]] || [[ "$1" == "SkyBlock" ]] ||
[[ "$1" == "Lobby" ]]
then
function find_screen {
if screen -ls "$1" | grep -o "^\s*[0-9]*\.$1[ "$'\t'"](" --color=NEVER -m 1 | grep -oh "[0-9]*\.$1" --color=NEVER -m 1 -q >/dev/null; then
screen -ls "$1" | grep -o "^\s*[0-9]*\.$1[ "$'\t'"](" --color=NEVER -m 1 | grep -oh "[0-9]*\.$1" --color=NEVER -m 1 2>/dev/null
return 0
else
return 1
fi
}
if find_screen "$1" >/dev/null;
then
screen -x beta #using x if screen already attached
else
screen -dmS beta
screen -r beta -p 0 -X stuff $"$PWD/.loopserver.sh php $1 -l
"
screen -r beta
fi
else
echo "$1"
echo "Server type must be SkyBlock, Prison or Lobby"
exit 1
fi