Set macOS localtime using main.cfg

Not sure where the old reference to an "other" timezone came from.
Going to use the POSIX style esp. after finding the answer below.
Thankfully both options appear in macOS 10.11-10.15 in my testing.
https://stackoverflow.com/a/4309852
This commit is contained in:
2Shirt 2021-04-04 03:24:56 -06:00
parent 695bf03bcb
commit ecbbf5511c
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -73,14 +73,15 @@ rsync -aS com.apple.Terminal.plist "${WK_PATH}/var/root/Library/Preferences"/
# Timezones
echo "Installing timezones..."
eval "$(fgrep LINUX_TIME ../../scripts/wk/cfg/main.py)"
if [[ "${OS_VERSION:3:2}" == "11" ]]; then
rsync -aS /usr/share/zoneinfo/ "${WK_PATH}/usr/share/zoneinfo"/
ln -sf /usr/share/zoneinfo/America/Los_Angeles "${WK_PATH}/etc/localtime"
ln -sf "/usr/share/zoneinfo/${LINUX_TIME}" "${WK_PATH}/etc/localtime"
elif [[ "${OS_VERSION:3:2}" -gt "11" ]]; then
if [[ ! -d "${WK_PATH}/var/db/timezone" ]]; then
rsync -aS /var/db/timezone "${WK_PATH}/var/db"/
fi
ln -sf /var/db/timezone/zoneinfo/US/Pacific "${WK_PATH}/etc/localtime"
ln -sf "/var/db/timezone/zoneinfo/${LINUX_TIME}" "${WK_PATH}/etc/localtime"
fi
# zsh