mirror of
https://github.com/guezoloic/serverconfig.git
synced 2026-01-25 07:34:23 +00:00
feat: add info_print flag
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user