mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-24 08:46:59 +08:00
fix(install.sh): install crontab (exp)
This commit is contained in:
parent
c8c3289c79
commit
b31bcfe44b
|
@ -202,10 +202,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
|
||||
if [[ -z "$(crontab -l 2>/dev/null || true)" ]]; then
|
||||
echo "$CRON_JOB" | crontab -
|
||||
else
|
||||
( crontab -l | grep -vxF "${CRON_JOB}" | grep -v "no crontab for"; echo "$CRON_JOB" ) | crontab -
|
||||
elif !( crontab -l | grep -qxF "${CRON_JOB}"); then
|
||||
( crontab -l; echo "$CRON_JOB" ) | crontab -
|
||||
fi
|
||||
else
|
||||
fmt_warning "crontab does not exist. skipping ..."
|
||||
|
|
Loading…
Reference in New Issue
Block a user