From ecbbf5511c60405595285c8b5f9ab1f60c6a4949 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 4 Apr 2021 03:24:56 -0600 Subject: [PATCH] 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 --- setup/macos/update-base-image | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup/macos/update-base-image b/setup/macos/update-base-image index 307a8b57..c010cd43 100755 --- a/setup/macos/update-base-image +++ b/setup/macos/update-base-image @@ -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