-
Notifications
You must be signed in to change notification settings - Fork 8
/
ut4wd.sh
47 lines (44 loc) · 1.16 KB
/
ut4wd.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
#Snir's UT4 Server Suite
#Watchdog module
for cnffiles in ddut4_init.def
do
if [ -f "$cnffiles" ]
then
source "$cnffiles"
if [[ $? != '0' ]]
then
echo "Couldn't load ${cnffiles}. Terminating."
exit 1
#no need for 'else' here
fi
#iecho "Loaded configuration file: $(pwd)/${cnffiles}"
else
echo "Couldn't find ${cnffiles}. Terminating."
exit 1
fi
done
sheader
echo "Watchdog module"
echo
if [[ $1 == '' ]]
then
echo "Syntax: $0 GAMETYPES (separated by space)"
echo "Example: $0 DM CTF"
echo
exit 1
fi
echo "Running watchdog module in background..."
(while true
do
for i in $@
do
if [ ! -f ${rootdir}/ut4-$i/updateflag ]
then
cd "${rootdir}"
./launchServer.sh $i wd &
fi
done
sleep $wdrefresh
done &) &
disown