-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
32 lines (26 loc) · 1.14 KB
/
entrypoint.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
#!/bin/sh
# ulimit -n 100000
cd ${STEAMCMDDIR}
chown ${USER}.${USER} -R /opt/
function stop_server {
/opt/manage/rcon.py localhost ${QUERYPORT} ${RCONPASSWD} saveworld
/opt/manage/rcon.py localhost ${QUERYPORT} ${RCONPASSWD} doexit
}
trap stop_server INT
trap stop_server TERM
if [ -e "/home/steam/.steam/sdk32/steamclient.so" ]
then
echo "steamclient.so found."
else
echo "steamclient.so not found."
su steam -c "ln -s ${STEAMCMDDIR}/linux32/steamclient.so ~/.steam/sdk32/steamclient.so"
if [ -e "/home/steam/.steam/sdk32/steamclient.so" ]
then
echo "steamclient.so link created."
fi
fi
${STEAMCMDDIR}/steamcmd.sh +@sSteamCmdForcePlatformType linux +login anonymous \
+force_install_dir ${SERVERDIR}/ark_server/ +app_update 376030 \
+quit
# server start
su ${USER} -c "cd ${SERVERDIR}/ark_server/ && ./ShooterGame/Binaries/Linux/ShooterGameServer ${MAP}?listen?Multihome=0.0.0.0?SessionName="${SERVERNAME}"?MaxPlayers=${MAXPLAYERS}?Port=${PORT}?QueryPort=${QUERYPORT}?RCONEnabled=${RCON}?RCONPort=${RCONPORT}?ServerAdminPassword=${RCONPASSWD}?ServerPassword=${PASSWD} -NoBattlEye -crossplay -server -log -servergamelog"