Skip to content
Snippets Groups Projects
Commit 397ca5d4 authored by Dylan Wheeler's avatar Dylan Wheeler
Browse files

style: reformatting for more uniform style

parent cb74b5b5
No related branches found
No related tags found
1 merge request!158FEAT: introduce shell script to allow user to disable another users crontab...
#!/bin/bash #!/bin/bash
usage() { usage() {
echo "Usage: $0 -d USERNAME to disable a user" echo "Usage: $0 -d USERNAME to disable a user"
echo "Usage: $0 -e USERNAME to re-enable a user" echo "Usage: $0 -e USERNAME to re-enable a user"
} }
if [[ "$EUID" -ne 0 ]]; then if [[ "$EUID" -ne 0 ]]; then
echo "This script must be run as root!" echo "This script must be run as root!"
exit 1 exit 1
fi fi
if [ "$#" -eq 0 ]; then if [ "$#" -eq 0 ]; then
usage usage
exit 1 exit 1
fi fi
while getopts ':d:e:' OPTION; do while getopts ':d:e:' OPTION; do
case $OPTION in case $OPTION in
d) d)
mv /var/spool/cron/$OPTARG /var/spool/cron/$OPTARG.disabled mv /var/spool/cron/$OPTARG /var/spool/cron/$OPTARG.disabled
echo $OPTARG >> /etc/cron.deny echo $OPTARG >>/etc/cron.deny
;; ;;
e) e)
mv /var/spool/cron/$OPTARG.disabled /var/spool/cron/$OPTARG mv /var/spool/cron/$OPTARG.disabled /var/spool/cron/$OPTARG
sed -i -e "/$OPTARG/d" /etc/cron.deny sed -i -e "/$OPTARG/d" /etc/cron.deny
;; ;;
esac esac
done done
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment