Created
April 27, 2011 19:27
-
-
Save skull-squadron/944992 to your computer and use it in GitHub Desktop.
Script to restart an apple mac os x 10.6 built-in service
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
#!/usr/bin/env bash | |
if [[ "`uname -s`" != "Darwin" ]] | |
then | |
echo "Error: can only restart system services on Macs." | |
exit 1 | |
done | |
sudo bash -c "launchctl unload /System/Library/LaunchDaemons/com.apple.$1.plist; sleep 3; launchctl load /System/Library/LaunchDaemons/com.apple.$1.plist" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment