fix: clean statement missed ";" before "then"

This commit is contained in:
2025-07-30 21:12:33 +02:00
parent d8276ba9d6
commit 46becfa962

View File

@@ -1,12 +1,12 @@
#!/bin/bash #!/bin/bash
source /usr/local/bin/common.sh source /usr/local/bin/libs/common.sh
source /etc/serverconfig/.env source /etc/serverconfig/.env
INSTALLED=$1
DIR="$(cd "$(dirname "$0")" && pwd)" DIR="$(cd "$(dirname "$0")" && pwd)"
BACKUP="$ETC_DIR/aws-bakup.bak" BACKUP="$ETC_DIR/aws-backup.bak"
INSTALLED=$1
if [[ "--install" == $INSTALLED ]]; then if [[ "--install" == $INSTALLED ]]; then
info_print "\n\ info_print "\n\
==================================================\n\ ==================================================\n\
@@ -25,7 +25,7 @@ if [[ "--install" == $INSTALLED ]]; then
read -p "Enter value for $key: " value read -p "Enter value for $key: " value
create_env_variable "$key" "$value" $BACKUP create_env_variable "$key" "$value" $BACKUP
done done
info_print "You can add more later by editing $BACKUP." info_print "You can add more names later by editing $BACKUP."
CRON_JOB="0 0 * * * $SCRIPT_FILE/aws-backup.sh" CRON_JOB="0 0 * * * $SCRIPT_FILE/aws-backup.sh"
crontab -l | grep -F "$CRON_JOB" > /dev/null 2>&1 crontab -l | grep -F "$CRON_JOB" > /dev/null 2>&1
@@ -33,9 +33,11 @@ if [[ "--install" == $INSTALLED ]]; then
(crontab -l 2>/dev/null; echo "$CRON_JOB") | crontab - (crontab -l 2>/dev/null; echo "$CRON_JOB") | crontab -
info_print "Cron job added." 6 info_print "Cron job added." 6
fi fi
exit 0
fi fi
if [[ "$1" == "clean" ]] then if [[ "$1" == "clean" ]]; then
info_print "Purge aws-bak files." info_print "Purge aws-bak files."
rm -f $BACKUP rm -f $BACKUP
exit 0 exit 0
@@ -56,4 +58,7 @@ while IFS= read -r SOURCE_PATH || [ -n "$SOURCE_PATH" ]; do
else else
info_print "$SOURCE_PATH not found or inaccessible." 3 info_print "$SOURCE_PATH not found or inaccessible." 3
fi fi
done < "$BACKUP" done < "$BACKUP"
source /usr/local/bin/libs/notifications.sh
send_notification "All AWS-backup file have been linked"