Created
February 13, 2014 18:50
-
-
Save mattkasa/8981322 to your computer and use it in GitHub Desktop.
This file contains 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 | |
case "${1}" in | |
disable) | |
# Disable chef-client cron job | |
knife ssh "${2}" 'sudo bash -c "crontab -l | sed -e /^[^#].*\\\\/usr\\\\/bin\\\\/chef-client/s/^/#/ | crontab -"' | |
;; | |
enable) | |
# Enable chef-client cron job | |
knife ssh "${2}" 'sudo bash -c "crontab -l | sed -e /^#.*\\\\/usr\\\\/bin\\\\/chef-client/s/^#// | crontab -"' | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment