made script auto switch between Boston/Nashville

This commit is contained in:
Vlad Doster 2020-04-02 02:21:54 -05:00 committed by GitHub
parent 76c7616eab
commit c27cf2b535
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 4 deletions

View File

@ -1,4 +0,0 @@
#!/bin/sh
ln -sf /usr/share/zoneinfo/US/Central /etc/localtime

15
.local/bin/change_timezones Executable file
View File

@ -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