Skip to content

Commit

Permalink
End script if RCON is disabled
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Martinez <[email protected]>
  • Loading branch information
seoseonyu and Dashboy1998 authored Jan 31, 2024
1 parent 8163be0 commit 2e0186e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ if [ -f "$BACKUP_FILE" ]; then
# Shutdown server
trap 'term_error_handler' ERR

printf "\e[0;32m*****SHUTDOWN SERVER*****\e[0m\n"
if [ "${RCON_ENABLED}" = true ]; then
printf "\e[0;32m*****SHUTDOWN SERVER*****\e[0m\n"
rcon-cli -c /home/steam/server/rcon.yaml save
rcon-cli -c /home/steam/server/rcon.yaml "shutdown 1"
else
echo "RCON is not enabled. Please enable RCON to use this feature."
echo "RCON is not enabled. Please enable RCON to use this feature. Unable to restore backup."
exit 1
fi
printf "\e[0;32mShutdown complete.\e[0m\n"

Expand Down

0 comments on commit 2e0186e

Please sign in to comment.