-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
executable file
·34 lines (28 loc) · 1.04 KB
/
update.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
#!/bin/bash
# assumes you are running your game server as a service
SERVICE=palworld
# Folder location of steamcmd
STEAMCMDFOLDER=/home/janthony/steamcmd
# name of the folder you used when installing the game via steamcmd
STEAMGAMEFOLDER=${STEAMCMDFOLDER}/Palworld-server
# Steam App ID of the game
STEAMAPPID=2394010
# Check if palworld is running
STATUS="$(systemctl is-active ${SERVICE}.service)"
if [ "${STATUS}" = "active" ]; then
echo "${SERVICE} is running. Can not update the service."
else
echo "${SERVICE} is stopped. Running update command."
# assumes you have steamcmd installed
if [[ ! -f "${STEAMCMDFOLDER}/steamcmd.sh" ]]; then
echo "Failure fetching steamcmd to update ${SERVICE}."
exit 1
fi
# Perform update
"${STEAMCMDFOLDER}/steamcmd.sh" +login anonymous +force_install_dir /${STEAMGAMEFOLDER}/Game +app_update ${STEAMAPPID} validate +exit | grep 'Success!'
result=$?
if [ $result -ne 0 ]; then
echo "Failure when running updates for ${SERVICE}."
exit 1
fi
fi