forked from crawl/dgamelaunch-config
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·44 lines (39 loc) · 1.12 KB
/
entrypoint.sh
File metadata and controls
executable file
·44 lines (39 loc) · 1.12 KB
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
#!/bin/bash
git config --global --add safe.directory '*'
if [ -z "$CMD" ]; then
"$SCRIPTS"/dgl/generate-conf.sh
dgl create-versions-db
dgl create-crawl-gamedir
dgl publish --confirm
else
"$SCRIPTS"/dgl/generate-conf.sh
dgl create-versions-db
dgl create-crawl-gamedir
dgl publish --confirm
echo
eval "$CMD"
exit 0
fi
INIT_FLAG_FILE="/var/run/dcss-server-init"
if [ ! -f "$INIT_FLAG_FILE" ]; then
"$SCRIPTS"/init.sh
touch "$INIT_FLAG_FILE"
fi
function safe-exit {
echo "Removing crawl-update.lock..."
rm -rf /home/crawl-dev/dgamelaunch-config/locks/crawl-update.lock
echo "Removing git index.lock..."
rm -rf /home/crawl-dev/dgamelaunch-config/crawl-build/crawl-git-repository/.git/index.lock
echo "Stopping SSH service..."
service ssh stop
echo "Stopping webtiles service..."
/etc/init.d/webtiles stop
rm -rf "$DGL_CHROOT/crawl-master/webserver/run/webtiles.pid"
echo "Waiting for 5 seconds..."
sleep 5
echo "Exiting script."
exit 0
}
trap 'safe-exit' EXIT
"$SCRIPTS"/run.sh
tail -f "$DGL_CHROOT/crawl-master/webserver/run/webtiles.log"