Skip to content

Commit

Permalink
Fix cronjob adding/deletion
Browse files Browse the repository at this point in the history
Fixes #79.

Be more explicit about how the commands for modifying the crontab should
be piped and switch to fgrep since no regular expressions are necessary
to remove the crontab entry.
  • Loading branch information
sseemayer committed Sep 11, 2016
1 parent 0476e27 commit 007323e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subcommands/cron-job
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ letsencrypt_cron_job_add () {
#shellcheck disable=SC2034
declare desc="Add auto-renew cronjob to dokku user's crontab"

(crontab -l || true | grep -v "$CRON_CMD" || true; echo "$CRON_JOB") | crontab -
((crontab -l || true) | (fgrep -v "$CRON_CMD" || true); echo "$CRON_JOB") | crontab -
dokku_log_info1 "Added cron job to dokku's crontab."
}
letsencrypt_cron_job_remove () {
#shellcheck disable=SC2034
declare desc="Remove auto-renew cronjob from dokku user's crontab"
crontab -l || true | grep -v "$CRON_CMD" || true | crontab -
(crontab -l || true) | (fgrep -v "$CRON_CMD" || true) | crontab -
dokku_log_info1 "Removed cron job from dokku's crontab."
}
Expand Down

0 comments on commit 007323e

Please sign in to comment.