Skip to content

Instantly share code, notes, and snippets.

@eugenestarchenko
Forked from gjpalau/timezone.sh
Created February 19, 2018 12:19
Show Gist options
  • Select an option

  • Save eugenestarchenko/275e2c6c2beb8838da7d5eb396179674 to your computer and use it in GitHub Desktop.

Select an option

Save eugenestarchenko/275e2c6c2beb8838da7d5eb396179674 to your computer and use it in GitHub Desktop.
Script for managing timezones
#!/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