feat: add info_print flag

This commit is contained in:
2025-09-08 18:11:51 +00:00
parent 040f050d98
commit efc3065b55
7 changed files with 41 additions and 28 deletions

View File

@@ -39,7 +39,7 @@ if [[ "--install" == $INSTALLED ]]; then
crontab -l | grep -F "$CRON_JOB" > /dev/null 2>&1
if ! crontab -l | grep -Fq "$CRON_JOB"; then
(crontab -l 2>/dev/null; echo "$CRON_JOB") | crontab -
info_print "Cron job added." 6
info_print "Cron job added." $SUCCESS_FLAG
fi
exit 0
@@ -76,16 +76,16 @@ while IFS= read -r SOURCE_PATH || [ -n "$SOURCE_PATH" ]; do
"${aws_cmd[@]}"
if [ $? -ne 0 ]; then
info_print "Error while syncing $SOURCE_PATH to the AWS server." 3
info_print "Error while syncing $SOURCE_PATH to the AWS server." $ERROR_FLAG
BACKUPSUCCESSED=false
exit 1
else
info_print "Successfully synced $SOURCE_PATH" 6
info_print "Successfully synced $SOURCE_PATH" $SUCCESS_FLAG
BACKUPSUCCESSED=true
fi
else
info_print "$SOURCE_PATH not found or inaccessible." 3
info_print "$SOURCE_PATH not found or inaccessible." $ERROR_FLAG
BACKUPSUCCESSED=false
exit 1
fi