Created
March 4, 2015 15:49
-
-
Save gjpalau/f15eea9a8f2c2dd85f97 to your computer and use it in GitHub Desktop.
Script for managing timezones
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 | |
#### Set NTP Server | |
# Sets correct Timezone. If no Timezone is set, then default is CST | |
timezone=$1 | |
if [ "$timezone" = "CST" ] | |
then | |
echo "America/Chicago" | |
systemsetup -settimezone America/Chicago | |
elif [ "$timezone" = "EST" ] | |
then | |
echo "America/New_York" | |
systemsetup -settimezone America/New_York | |
elif [ "$timezone" = "MST" ] | |
then | |
echo "America/Denver" | |
systemsetup -settimezone America/Denver | |
elif [ "$timezone" = "PST" ] | |
then | |
echo "America/Los_Angeles" | |
systemsetup -settimezone America/Los_Angeles | |
else | |
echo "No input provided -- Defaulting to Central Time" | |
echo "America/Chicago" | |
systemsetup -settimezone America/Chicago | |
fi | |
systemsetup -setnetworktimeserver insert.time.server.here | |
systemsetup -setusingnetworktime on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment