forked from coolstation/coolstructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunchgame.sh
executable file
·49 lines (39 loc) · 1.53 KB
/
launchgame.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
48
49
#!/bin/bash
LIVEDIR=/home/ss13/coolserv/live
LOCKFILE=${LIVEDIR}/daemon-in-the-dark
for t in {1..12}
do
if [ -z "$(ps -C DreamDaemon | grep DreamDaemon)" ]
then
if [[ -f ${LIVEDIR}/coeding-sounds ]]
then
# We should never get here, but this means we're trying to
# start in a directory that the build process is running
# on.
sleep 5
continue # skip to the next go-around
fi
# If this file exists, then DreamDaemon shuts down on world/Reboot(). It then requires
# something external to start it back up again. Oh, hey, it us; the external something!
touch ${LIVEDIR}/data/hard-reboot
# If this file exists, the fusilli build script will not overwrite this directory.
touch ${LOCKFILE}
# Launch the game server in background.
# Yes, I really actually meant in the background this time!
echo "ok so this is the line before the server should launch, and im excited?????" > ./fart_busshole
/home/ss13/byond/bin/DreamDaemon "${LIVEDIR}/coolstation.dmb" 8085 -trusted &
# Grab the background process' PID
DD_PID=$!
# Put the lime in the coconut
echo ${DD_PID} > ${LOCKFILE}
# A little delayed build action, maybe
echo "ok so this is the line before the delaybuild should launch, and im gay?????" > ./fart_busshole
/bin/bash /home/ss13/coolstructure/delaybuild.sh ${DD_PID} &
# Bring the server process back out of the background, and
# wait for it to serve its time.
wait ${DD_PID}
# Clean up after ourselves, since we're not using this directory any more
rm ${LOCKFILE}
fi
sleep 5
done