diff --git a/install.sh b/install.sh index 50a1ca0..24ffba3 100755 --- a/install.sh +++ b/install.sh @@ -203,9 +203,10 @@ install_crontab() if [[ -x $(command -v crontab) ]]; then fmt_note "installing \"$CRON_JOB\" to crontab ..." if ! crontab -l 1>/dev/null 2>&1; then - echo -n | crontab - + echo "$CRON_JOB" | crontab - + else + ( crontab -l | grep -vxF "${CRON_JOB}" | grep -v "no crontab for"; echo "$CRON_JOB" ) | crontab - fi - ( crontab -l | grep -vxF "${CRON_JOB}" | grep -v "no crontab for"; echo "$CRON_JOB" ) | crontab - else fmt_warning "crontab does not exist. skipping ..." fi