-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
97 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
# shellcheck source=scripts/variables.sh | ||
source "/home/steam/server/variables.sh" | ||
|
||
# shellcheck source=scripts/helper_functions.sh | ||
source "/home/steam/server/helper_functions.sh" | ||
|
||
# Helper Functions for installation & updates | ||
# shellcheck source=scripts/helper_install.sh | ||
source "/home/steam/server/helper_install.sh" | ||
|
||
UpdateRequired | ||
updateRequired=$? | ||
# Check if Update was actually required | ||
if [ "$updateRequired" != 0 ]; then | ||
exit 0 | ||
fi | ||
|
||
if [ "${UPDATE_ON_BOOT,,}" != true ]; then | ||
LogWarn "An update is available however, UPDATE_ON_BOOT needs to be enabled for auto updating" | ||
DiscordMessage "Update" "An update is available however, UPDATE_ON_BOOT needs to be enabled for auto updating" "warn" | ||
exit 1 | ||
fi | ||
|
||
if [[ "${AUTO_UPDATE_WARN_MINUTES}" =~ ^[0-9]+$ ]]; then | ||
DiscordMessage "Update" "Server will update in ${AUTO_UPDATE_WARN_MINUTES} minutes" | ||
fi | ||
|
||
sleep $((AUTO_UPDATE_WARN_MINUTES * 60)) | ||
|
||
LogAction "Updating the server from $CURRENT_MANIFEST to $TARGET_MANIFEST." | ||
|
||
backup | ||
shutdown_server |