2017-02-18 15:38:29 +00:00
|
|
|
#!/bin/bash
|
2018-05-15 22:00:14 +00:00
|
|
|
set -euxo pipefail
|
2017-02-18 15:38:29 +00:00
|
|
|
|
|
|
|
# Copy default rustserver script from Linux Game Server Managers when not present
|
2018-05-15 22:00:14 +00:00
|
|
|
[ -e /home/rustserver/rustserver ] || {
|
|
|
|
cp /opt/rustserver /home/rustserver/rustserver
|
|
|
|
chmod 0755 /home/rustserver/rustserver
|
|
|
|
}
|
2017-02-18 15:38:29 +00:00
|
|
|
|
|
|
|
/home/rustserver/rustserver "$@"
|
|
|
|
|
2018-05-15 22:00:14 +00:00
|
|
|
set +x
|
2017-02-18 15:38:29 +00:00
|
|
|
# Keep Docker container running until gameserver process is not longer available
|
2018-05-15 22:00:14 +00:00
|
|
|
while (pgrep RustDedicated >/dev/null 2>&1); do
|
|
|
|
sleep 1
|
2017-02-18 15:38:29 +00:00
|
|
|
done
|