voidrice/.local/bin/change_timezones
2020-04-02 03:22:37 -04:00

16 lines
368 B
Bash
Executable File

#!/bin/sh
tz=$(date "+%Z")
if (( $EUID != 0 )); then
echo "Please run as root"
exit
elif [[ "$tz" == "CDT" ]]; then
echo "Changing to Eastern Daylight Time timezone"
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
elif [[ "$tz" == "EDT" ]]; then
echo "Changing to Central timezone"
ln -sf /usr/share/zoneinfo/US/Central /etc/localtime
fi