Created
June 5, 2018 11:07
-
-
Save burik666/b8ba4a918da22439d01ef5498fcb235d to your computer and use it in GitHub Desktop.
crontab remove confirmation wrapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# alias crontab=/path/to/crontab_wrapper.sh | |
while getopts ":r" opt | |
do | |
case $opt in | |
r) | |
read -r -n 1 -p "Do really want to remove current crontab? [Y/n]" confirm | |
echo | |
if [ "$confirm" != "Y" ]; then | |
exit 1 | |
fi | |
;; | |
*);; | |
esac | |
done | |
/usr/bin/crontab "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment