Skip to content

Instantly share code, notes, and snippets.

@burik666
Created June 5, 2018 11:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burik666/b8ba4a918da22439d01ef5498fcb235d to your computer and use it in GitHub Desktop.
Save burik666/b8ba4a918da22439d01ef5498fcb235d to your computer and use it in GitHub Desktop.
crontab remove confirmation wrapper
#!/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