From 4464ba08d979db2f062c652ea4c08d9980cc99af Mon Sep 17 00:00:00 2001 From: Thijs van Loef Date: Mon, 5 Feb 2024 18:59:14 +0100 Subject: [PATCH] fix some more linting --- scripts/backup.sh | 12 ++++++------ scripts/init.sh | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/backup.sh b/scripts/backup.sh index 04b4bed73..30eaed7c7 100644 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -1,7 +1,7 @@ #!/bin/bash if [ -n "${DISCORD_WEBHOOK_ID}" ]; then - /home/steam/server/discord.sh -i "$DISCORD_WEBHOOK_ID" -c "$DISCORD_CONNECT_TIMEOUT" -M "$DISCORD_MAX_TIMEOUT" -m "Creating backup..." -l "in-progress" & + /home/steam/server/discord.sh -i "{$DISCORD_WEBHOOK_ID}" -c "{$DISCORD_CONNECT_TIMEOUT}" -M "{$DISCORD_MAX_TIMEOUT}" -m "Creating backup..." -l "in-progress" & fi if [ "${RCON_ENABLED,,}" = true ]; then @@ -21,7 +21,7 @@ fi echo "Backup created at ${FILE_PATH}" if [ -n "${DISCORD_WEBHOOK_ID}" ]; then - /home/steam/server/discord.sh -i "$DISCORD_WEBHOOK_ID" -c "$DISCORD_CONNECT_TIMEOUT" -M "$DISCORD_MAX_TIMEOUT" -m "Backup created at ${FILE_PATH}" -l "success" + /home/steam/server/discord.sh -i "{$DISCORD_WEBHOOK_ID}" -c "{$DISCORD_CONNECT_TIMEOUT}" -M "{$DISCORD_MAX_TIMEOUT}" -m "Backup created at ${FILE_PATH}" -l "success" fi if [ "${DELETE_OLD_BACKUPS,,}" = true ]; then @@ -29,21 +29,21 @@ if [ "${DELETE_OLD_BACKUPS,,}" = true ]; then if [ -z "${OLD_BACKUP_DAYS}" ]; then echo "Unable to delete old backups, OLD_BACKUP_DAYS is empty." if [ -n "${DISCORD_WEBHOOK_ID}" ]; then - /home/steam/server/discord.sh -i "$DISCORD_WEBHOOK_ID" -c "$DISCORD_CONNECT_TIMEOUT" -M "$DISCORD_MAX_TIMEOUT" -m "Unable to delete old backups, OLD_BACKUP_DAYS is empty." -l "warn" + /home/steam/server/discord.sh -i "{$DISCORD_WEBHOOK_ID}" -c "{$DISCORD_CONNECT_TIMEOUT}" -M "{$DISCORD_MAX_TIMEOUT}" -m "Unable to delete old backups, OLD_BACKUP_DAYS is empty." -l "warn" fi elif [[ "${OLD_BACKUP_DAYS}" =~ ^[0-9]+$ ]]; then echo "Removing backups older than ${OLD_BACKUP_DAYS} days" if [ -n "${DISCORD_WEBHOOK_ID}" ] && [ -n "${DISCORD_PRE_BACKUP_DELETE_MESSAGE}" ]; then - /home/steam/server/discord.sh -i "$DISCORD_WEBHOOK_ID" -c "$DISCORD_CONNECT_TIMEOUT" -M "$DISCORD_MAX_TIMEOUT" -m "Removing backups older than ${OLD_BACKUP_DAYS} days..." -l "in-progress" & + /home/steam/server/discord.sh -i "{$DISCORD_WEBHOOK_ID}" -c "{$DISCORD_CONNECT_TIMEOUT}" -M "{$DISCORD_MAX_TIMEOUT}" -m "Removing backups older than ${OLD_BACKUP_DAYS} days..." -l "in-progress" & fi find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime "+${OLD_BACKUP_DAYS}" -type f -name 'palworld-save-*.tar.gz' -print -delete if [ -n "${DISCORD_WEBHOOK_ID}" ]; then - /home/steam/server/discord.sh -i "$DISCORD_WEBHOOK_ID" -c "$DISCORD_CONNECT_TIMEOUT" -M "$DISCORD_MAX_TIMEOUT" -m "Removed backups older than ${OLD_BACKUP_DAYS} days" -l "success" + /home/steam/server/discord.sh -i "{$DISCORD_WEBHOOK_ID}" -c "{$DISCORD_CONNECT_TIMEOUT}" -M "{$DISCORD_MAX_TIMEOUT}" -m "Removed backups older than ${OLD_BACKUP_DAYS} days" -l "success" fi else echo "Unable to delete old backups, OLD_BACKUP_DAYS is not an integer. OLD_BACKUP_DAYS=${OLD_BACKUP_DAYS}" if [ -n "${DISCORD_WEBHOOK_ID}" ]; then - /home/steam/server/discord.sh -i "$DISCORD_WEBHOOK_ID" -c "$DISCORD_CONNECT_TIMEOUT" -M "$DISCORD_MAX_TIMEOUT" -m "Unable to delete old backups, OLD_BACKUP_DAYS is not an integer. OLD_BACKUP_DAYS=${OLD_BACKUP_DAYS}" -l "failure" + /home/steam/server/discord.sh -i "{$DISCORD_WEBHOOK_ID}" -c "{$DISCORD_CONNECT_TIMEOUT}" -M "{$DISCORD_MAX_TIMEOUT}" -m "Unable to delete old backups, OLD_BACKUP_DAYS is not an integer. OLD_BACKUP_DAYS=${OLD_BACKUP_DAYS}" -l "failure" fi fi fi \ No newline at end of file diff --git a/scripts/init.sh b/scripts/init.sh index 5d827d196..6642063ec 100644 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -15,7 +15,7 @@ chown -R steam:steam /palworld /home/steam/ # shellcheck disable=SC2317 term_handler() { if [ -n "${DISCORD_WEBHOOK_ID}" ] && [ -n "${DISCORD_PRE_SHUTDOWN_MESSAGE}" ]; then - su steam -c "/home/steam/server/discord.sh -i $DISCORD_WEBHOOK_ID -c $DISCORD_CONNECT_TIMEOUT -M $DISCORD_MAX_TIMEOUT -m '$DISCORD_PRE_SHUTDOWN_MESSAGE' -l in-progress" & + su steam -c "/home/steam/server/discord.sh -i ${DISCORD_WEBHOOK_ID} -c ${DISCORD_CONNECT_TIMEOUT} -M ${DISCORD_MAX_TIMEOUT} -m '${DISCORD_PRE_SHUTDOWN_MESSAGE}' -l in-progress" & fi if [ "${RCON_ENABLED,,}" = true ]; then