Skip to content

Commit

Permalink
Moved in_ to countdown message
Browse files Browse the repository at this point in the history
  • Loading branch information
Dashboy1998 committed Feb 16, 2024
1 parent 22683fd commit 8bef267
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/auto_reboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if [ "${RCON_ENABLED,,}" = true ]; then
if [ -z "${AUTO_REBOOT_WARN_MINUTES}" ]; then
echo "Unable to auto reboot, AUTO_REBOOT_WARN_MINUTES is empty."
elif [[ "${AUTO_REBOOT_WARN_MINUTES}" =~ ^[0-9]+$ ]]; then
countdown_message "${AUTO_REBOOT_WARN_MINUTES}" "The_Server_will_reboot_in"
countdown_message "${AUTO_REBOOT_WARN_MINUTES}" "The_Server_will_reboot"
rcon-cli -c /home/steam/server/rcon.yaml save
rcon-cli -c /home/steam/server/rcon.yaml "shutdown 1"
else
Expand Down
8 changes: 4 additions & 4 deletions scripts/helper_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ countdown_message() {
break
fi
if [ "$i" -eq 1 ]; then
rcon-cli -c /home/steam/server/rcon.yaml "broadcast ${message_prefix}_${i}_minute"
rcon-cli -c /home/steam/server/rcon.yaml "broadcast ${message_prefix}_in_${i}_minute"
sleep 30s
rcon-cli -c /home/steam/server/rcon.yaml "broadcast ${message_prefix}_30_seconds"
rcon-cli -c /home/steam/server/rcon.yaml "broadcast ${message_prefix}_in_30_seconds"
sleep 20s
rcon-cli -c /home/steam/server/rcon.yaml "broadcast ${message_prefix}_10_seconds"
rcon-cli -c /home/steam/server/rcon.yaml "broadcast ${message_prefix}_in_10_seconds"
sleep 10s
else
case "$i" in
Expand All @@ -106,7 +106,7 @@ countdown_message() {
5 )
;&
2 )
rcon-cli -c /home/steam/server/rcon.yaml "broadcast ${message_prefix}_${i}_minutes"
rcon-cli -c /home/steam/server/rcon.yaml "broadcast ${message_prefix}_in_${i}_minutes"
;&
* )
sleep 1m
Expand Down
2 changes: 1 addition & 1 deletion scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if [ "$CURRENT_MANIFEST" != "$TARGET_MANIFEST" ]; then
if [ -n "${DISCORD_WEBHOOK_URL}" ]; then
/home/steam/server/discord.sh "Server will update in ${AUTO_UPDATE_WARN_MINUTES} minutes" "info" &
fi
countdown_message "${AUTO_UPDATE_WARN_MINUTES}" "Server_will_update_in"
countdown_message "${AUTO_UPDATE_WARN_MINUTES}" "Server_will_update"

backup
rcon-cli -c /home/steam/server/rcon.yaml "shutdown 1"
Expand Down

0 comments on commit 8bef267

Please sign in to comment.