diff --git a/.local/bin/change_timezone_to_central b/.local/bin/change_timezone_to_central deleted file mode 100755 index 51a78d99..00000000 --- a/.local/bin/change_timezone_to_central +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -ln -sf /usr/share/zoneinfo/US/Central /etc/localtime - diff --git a/.local/bin/change_timezones b/.local/bin/change_timezones new file mode 100755 index 00000000..3ce0606e --- /dev/null +++ b/.local/bin/change_timezones @@ -0,0 +1,15 @@ +#!/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 +