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

@@ -9,11 +9,16 @@ if [[ "--install" == $INSTALLED ]]; then
==================================================\n\
disk-monitor Installation\n\
--------------------------------------------------"
if ! command -v crontab >/dev/null 2>&1; then
info_print "Cron job added." $ERROR_FLAG
exit 1
fi
CRON_JOB="0 3 * * 1 $SCRIPT_FILE/scripts/disk-monitor.sh"
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;
fi