diff --git a/Dockerfile b/Dockerfile index 4c0632be9..4871a540c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -118,25 +118,25 @@ ENV HOME=/home/steam \ DISCORD_POST_SHUTDOWN_MESSAGE="Server has been stopped!" \ DISCORD_POST_SHUTDOWN_MESSAGE_URL= \ DISCORD_POST_SHUTDOWN_MESSAGE_ENABLED=true \ - DISCORD_PLAYER_JOIN_MESSAGE="\${player_name} has joined Palworld!" \ + DISCORD_PLAYER_JOIN_MESSAGE="player_name has joined Palworld!" \ DISCORD_PLAYER_JOIN_MESSAGE_URL= \ DISCORD_PLAYER_JOIN_MESSAGE_ENABLED=true \ - DISCORD_PLAYER_LEAVE_MESSAGE="\${player_name} has left Palworld." \ + DISCORD_PLAYER_LEAVE_MESSAGE="player_name has left Palworld." \ DISCORD_PLAYER_LEAVE_MESSAGE_URL= \ DISCORD_PLAYER_LEAVE_MESSAGE_ENABLED=true \ DISCORD_PRE_BACKUP_MESSAGE="Creating backup..." \ DISCORD_PRE_BACKUP_MESSAGE_URL= \ DISCORD_PRE_BACKUP_MESSAGE_ENABLED=true \ - DISCORD_POST_BACKUP_MESSAGE="Backup created at \${FILE_PATH}" \ + DISCORD_POST_BACKUP_MESSAGE="Backup created at file_path" \ DISCORD_POST_BACKUP_MESSAGE_URL= \ DISCORD_POST_BACKUP_MESSAGE_ENABLED=true \ - DISCORD_PRE_BACKUP_DELETE_MESSAGE="Removing backups older than \${OLD_BACKUP_DAYS} days" \ + DISCORD_PRE_BACKUP_DELETE_MESSAGE="Removing backups older than old_backup_days days" \ DISCORD_PRE_BACKUP_DELETE_URL= \ DISCORD_PRE_BACKUP_DELETE_ENABLED=true \ - DISCORD_POST_BACKUP_DELETE_MESSAGE="Removed backups older than \${OLD_BACKUP_DAYS} days" \ + DISCORD_POST_BACKUP_DELETE_MESSAGE="Removed backups older than old_backup_days days" \ DISCORD_POST_BACKUP_DELETE_URL= \ DISCORD_POST_BACKUP_DELETE_ENABLED=true \ - DISCORD_ERR_BACKUP_DELETE_MESSAGE="Unable to delete old backups, OLD_BACKUP_DAYS is not an integer. OLD_BACKUP_DAYS=\${OLD_BACKUP_DAYS}" \ + DISCORD_ERR_BACKUP_DELETE_MESSAGE="Unable to delete old backups, OLD_BACKUP_DAYS is not an integer. OLD_BACKUP_DAYS=old_backup_days" \ DISCORD_ERR_BACKUP_DELETE_URL= \ DISCORD_ERR_BACKUP_DELETE_ENABLED=true \ ENABLE_PLAYER_LOGGING=true \ diff --git a/README.md b/README.md index 1a69f7ece..dc127c9ce 100644 --- a/README.md +++ b/README.md @@ -250,25 +250,25 @@ It is highly recommended you set the following environment values before startin | DISCORD_POST_SHUTDOWN_MESSAGE | Discord message sent when server has stopped | Server is stopped! | "string" | | DISCORD_POST_SHUTDOWN_MESSAGE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_POST_SHUTDOWN_MESSAGE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | -| DISCORD_PLAYER_JOIN_MESSAGE | Discord message sent when player joins the server | \${player_name} has joined Palworld! | "string" | +| DISCORD_PLAYER_JOIN_MESSAGE | Discord message sent when player joins the server | `player_name` has joined Palworld! | "string" | | DISCORD_PLAYER_JOIN_MESSAGE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_PLAYER_JOIN_MESSAGE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | -| DISCORD_PLAYER_LEAVE_MESSAGE | Discord message sent when player leaves the server | \${player_name} has left Palworld. | "string" | +| DISCORD_PLAYER_LEAVE_MESSAGE | Discord message sent when player leaves the server | `player_name` has left Palworld. | "string" | | DISCORD_PLAYER_LEAVE_MESSAGE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_PLAYER_LEAVE_MESSAGE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | | DISCORD_PRE_BACKUP_MESSAGE | Discord message when starting to create a backup | Creating backup... | "string" | | DISCORD_PRE_BACKUP_MESSAGE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_PRE_BACKUP_MESSAGE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | -| DISCORD_POST_BACKUP_MESSAGE | Discord message when a backup has been made | Backup created at \${FILE_PATH} | "string" | +| DISCORD_POST_BACKUP_MESSAGE | Discord message when a backup has been made | Backup created at `file_path` | "string" | | DISCORD_POST_BACKUP_MESSAGE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_POST_BACKUP_MESSAGE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | -| DISCORD_PRE_BACKUP_DELETE_MESSAGE | Discord message when starting to remove older backups | Removing backups older than \${OLD_BACKUP_DAYS} days | "string" | +| DISCORD_PRE_BACKUP_DELETE_MESSAGE | Discord message when starting to remove older backups | Removing backups older than `old_backup_days` days | "string" | | DISCORD_PRE_BACKUP_DELETE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_PRE_BACKUP_DELETE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | -| DISCORD_POST_BACKUP_DELETE_MESSAGE | Discord message when successfully removed older backups | Removed backups older than \${OLD_BACKUP_DAYS} days | "string" | +| DISCORD_POST_BACKUP_DELETE_MESSAGE | Discord message when successfully removed older backups | Removed backups older than `old_backup_days` days | "string" | | DISCORD_POST_BACKUP_DELETE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_POST_BACKUP_DELETE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | -| DISCORD_ERR_BACKUP_DELETE_MESSAGE | Discord message when there has been an error removing older backups | Unable to delete old backups, OLD_BACKUP_DAYS is not an integer. OLD_BACKUP_DAYS=\${OLD_BACKUP_DAYS} | "string" | +| DISCORD_ERR_BACKUP_DELETE_MESSAGE | Discord message when there has been an error removing older backups | Unable to delete old backups, OLD_BACKUP_DAYS is not an integer. OLD_BACKUP_DAYS=`old_backup_days` | "string" | | DISCORD_ERR_BACKUP_DELETE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_ERR_BACKUP_DELETE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | | DISABLE_GENERATE_SETTINGS | Whether to automatically generate the PalWorldSettings.ini | false | true/false | diff --git a/docusaurus/docs/getting-started/configuration/server-settings.md b/docusaurus/docs/getting-started/configuration/server-settings.md index 31809c6dc..d9950628b 100644 --- a/docusaurus/docs/getting-started/configuration/server-settings.md +++ b/docusaurus/docs/getting-started/configuration/server-settings.md @@ -70,25 +70,25 @@ It is highly recommended you set the following environment values before startin | DISCORD_POST_SHUTDOWN_MESSAGE | Discord message sent when server has stopped | Server is stopped! | "string" | | DISCORD_POST_SHUTDOWN_MESSAGE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_POST_SHUTDOWN_MESSAGE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | -| DISCORD_PLAYER_JOIN_MESSAGE | Discord message sent when player joins the server | `\${player_name}` has joined Palworld! | "string" | +| DISCORD_PLAYER_JOIN_MESSAGE | Discord message sent when player joins the server | `player_name` has joined Palworld! | "string" | | DISCORD_PLAYER_JOIN_MESSAGE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_PLAYER_JOIN_MESSAGE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | -| DISCORD_PLAYER_LEAVE_MESSAGE | Discord message sent when player leaves the server | `\${player_name}` has left Palworld. | "string" | +| DISCORD_PLAYER_LEAVE_MESSAGE | Discord message sent when player leaves the server | `player_name` has left Palworld. | "string" | | DISCORD_PLAYER_LEAVE_MESSAGE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_PLAYER_LEAVE_MESSAGE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | | DISCORD_PRE_BACKUP_MESSAGE | Discord message when starting to create a backup | Creating backup... | "string" | | DISCORD_PRE_BACKUP_MESSAGE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_PRE_BACKUP_MESSAGE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | -| DISCORD_POST_BACKUP_MESSAGE | Discord message when a backup has been made | Backup created at `\${FILE_PATH}` | "string" | +| DISCORD_POST_BACKUP_MESSAGE | Discord message when a backup has been made | Backup created at `file_path` | "string" | | DISCORD_POST_BACKUP_MESSAGE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_POST_BACKUP_MESSAGE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | -| DISCORD_PRE_BACKUP_DELETE_MESSAGE | Discord message when starting to remove older backups | Removing backups older than `\${OLD_BACKUP_DAYS}` days | "string" | +| DISCORD_PRE_BACKUP_DELETE_MESSAGE | Discord message when starting to remove older backups | Removing backups older than `old_backup_days` days | "string" | | DISCORD_PRE_BACKUP_DELETE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_PRE_BACKUP_DELETE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | -| DISCORD_POST_BACKUP_DELETE_MESSAGE | Discord message when successfully removed older backups | Removed backups older than `\${OLD_BACKUP_DAYS}` days | "string" | +| DISCORD_POST_BACKUP_DELETE_MESSAGE | Discord message when successfully removed older backups | Removed backups older than `old_backup_days` days | "string" | | DISCORD_POST_BACKUP_DELETE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_POST_BACKUP_DELETE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | -| DISCORD_ERR_BACKUP_DELETE_MESSAGE | Discord message when there has been an error removing older backups | Unable to delete old backups, OLD_BACKUP_DAYS is not an integer. OLD_BACKUP_DAYS=`\${OLD_BACKUP_DAYS}` | "string" | +| DISCORD_ERR_BACKUP_DELETE_MESSAGE | Discord message when there has been an error removing older backups | Unable to delete old backups, OLD_BACKUP_DAYS is not an integer. OLD_BACKUP_DAYS=`old_backup_days` | "string" | | DISCORD_ERR_BACKUP_DELETE_ENABLED | If the Discord message is enabled for this message | true | boolean | | DISCORD_ERR_BACKUP_DELETE_URL | Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) | | "string" | | DISABLE_GENERATE_SETTINGS | Whether to automatically generate the PalWorldSettings.ini | false | true/false | diff --git a/scripts/backup.sh b/scripts/backup.sh index f84a686f6..2e74bea0c 100644 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -18,7 +18,7 @@ if [ "$(id -u)" -eq 0 ]; then chown steam:steam "$FILE_PATH" fi LogInfo "Backup created at ${FILE_PATH}" -DiscordMessage "Backup" "${DISCORD_POST_BACKUP_MESSAGE//\$\{FILE_PATH\}/${FILE_PATH}}" "success" "${DISCORD_POST_BACKUP_MESSAGE_ENABLED}" "${DISCORD_POST_BACKUP_MESSAGE_URL}" +DiscordMessage "Backup" "${DISCORD_POST_BACKUP_MESSAGE//file_path/${FILE_PATH}}" "success" "${DISCORD_POST_BACKUP_MESSAGE_ENABLED}" "${DISCORD_POST_BACKUP_MESSAGE_URL}" if [ "${DELETE_OLD_BACKUPS,,}" != true ]; then exit 0 @@ -33,11 +33,11 @@ fi if [[ "${OLD_BACKUP_DAYS}" =~ ^[0-9]+$ ]]; then LogAction "Removing Old Backups" LogInfo "Removing backups older than ${OLD_BACKUP_DAYS} days" - DiscordMessage "Backup" "${DISCORD_PRE_BACKUP_DELETE_MESSAGE//\$\{FILE_PATH\}/${FILE_PATH}}" "in-progress" "${DISCORD_PRE_BACKUP_DELETE_MESSAGE_ENABLED}" "${DISCORD_PRE_BACKUP_DELETE_MESSAGE_URL}" + DiscordMessage "Backup" "${DISCORD_PRE_BACKUP_DELETE_MESSAGE//file_path/${FILE_PATH}}" "in-progress" "${DISCORD_PRE_BACKUP_DELETE_MESSAGE_ENABLED}" "${DISCORD_PRE_BACKUP_DELETE_MESSAGE_URL}" find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime "+${OLD_BACKUP_DAYS}" -type f -name 'palworld-save-*.tar.gz' -print -delete - DiscordMessage "Backup" "${DISCORD_POST_BACKUP_DELETE_MESSAGE//\$\{FILE_PATH\}/${FILE_PATH}}" "success" "${DISCORD_POST_BACKUP_DELETE_MESSAGE_ENABLED}" "${DISCORD_POST_BACKUP_DELETE_MESSAGE_URL}" + DiscordMessage "Backup" "${DISCORD_POST_BACKUP_DELETE_MESSAGE//file_path/${FILE_PATH}}" "success" "${DISCORD_POST_BACKUP_DELETE_MESSAGE_ENABLED}" "${DISCORD_POST_BACKUP_DELETE_MESSAGE_URL}" exit 0 fi LogError "Unable to delete old backups, OLD_BACKUP_DAYS is not an integer. OLD_BACKUP_DAYS=${OLD_BACKUP_DAYS}" -DiscordMessage "Backup" "${DISCORD_ERR_BACKUP_DELETE_MESSAGE//\$\{OLD_BACKUP_DAYS\}/${OLD_BACKUP_DAYS}}}" "failure" "${DISCORD_ERR_BACKUP_DELETE_MESSAGE_ENABLED}" "${DISCORD_ERR_BACKUP_DELETE_MESSAGE_URL}" \ No newline at end of file +DiscordMessage "Backup" "${DISCORD_ERR_BACKUP_DELETE_MESSAGE//old_backup_days/${OLD_BACKUP_DAYS}}}" "failure" "${DISCORD_ERR_BACKUP_DELETE_MESSAGE_ENABLED}" "${DISCORD_ERR_BACKUP_DELETE_MESSAGE_URL}" \ No newline at end of file diff --git a/scripts/player_logging.sh b/scripts/player_logging.sh index da811242f..37017b891 100644 --- a/scripts/player_logging.sh +++ b/scripts/player_logging.sh @@ -48,7 +48,7 @@ while true; do broadcast_command "${player_name} has left" # Replace ${player_name} with actual player's name - DiscordMessage "Player Left" "${DISCORD_PLAYER_LEAVE_MESSAGE//\$\{player_name\}/${player_name}}" "failure" "${DISCORD_PLAYER_LEAVE_MESSAGE_ENABLED}" "${DISCORD_PLAYER_LEAVE_MESSAGE_URL}" + DiscordMessage "Player Left" "${DISCORD_PLAYER_LEAVE_MESSAGE//player_name/${player_name}}" "failure" "${DISCORD_PLAYER_LEAVE_MESSAGE_ENABLED}" "${DISCORD_PLAYER_LEAVE_MESSAGE_URL}" done # Notify Discord and log all players who have joined @@ -58,7 +58,7 @@ while true; do broadcast_command "${player_name} has joined" # Replace ${player_name} with actual player's name - DiscordMessage "Player Joined" "${DISCORD_PLAYER_JOIN_MESSAGE//\$\{player_name\}/${player_name}}" "success" "${DISCORD_PLAYER_JOIN_MESSAGE_ENABLED}" "${DISCORD_PLAYER_JOIN_MESSAGE_URL}" + DiscordMessage "Player Joined" "${DISCORD_PLAYER_JOIN_MESSAGE//player_name/${player_name}}" "success" "${DISCORD_PLAYER_JOIN_MESSAGE_ENABLED}" "${DISCORD_PLAYER_JOIN_MESSAGE_URL}" done old_player_list=("${current_player_list[@]}")