Merge pull request #42 from meain/patch-2

Use `$HOME` instead of `/home/$(whoami)`
This commit is contained in:
Luke Smith 2018-03-17 22:00:44 -07:00 committed by GitHub
commit 920ee09626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,7 @@ chooseSync() { (crontab -l && testSync) || dialog --msgbox "No cronjob manager d
testSync() { (crontab -l | grep .config/mutt/etc/mailsync && removeSync) || addSync ;}
addSync() { min=$(dialog --inputbox "How many minutes should be between mail syncs?" 8 60 3>&1 1>&2 2>&3 3>&-)
(crontab -l; echo "*/$min * * * * /home/$(whoami)/.config/mutt/etc/mailsync.sh") | crontab - &&
(crontab -l; echo "*/$min * * * * $HOME/.config/mutt/etc/mailsync.sh") | crontab - &&
dialog --msgbox "Cronjob successfully added. Remember you may need to restart or tell systemd/etc. to start your cron manager for this to take effect." 7 60 ;}
removeSync() { ((crontab -l | sed -e '/.config\/mutt\/etc\/mailsync/d') | crontab - >/dev/null) && dialog --msgbox "Cronjob successfully removed. To reactivate, select this option again." 6 60 ;}