From 6123376288184f1093721c92a1fa1b8ea8abc754 Mon Sep 17 00:00:00 2001 From: Justin Karimi Date: Sat, 23 Jan 2021 21:08:37 -0500 Subject: [PATCH] Update Timezone to be Timezone Offset Update semantics of what the "timezone" parameter actually is in this context to make room for the actual timezone configuration. --- install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 0d66feb..9688914 100755 --- a/install.sh +++ b/install.sh @@ -262,13 +262,15 @@ read -rp "Enter your latitude (South values are negative): " read -rp "Enter your longitude (West values are negative): " lon=$REPLY -read -rp "Enter your timezone (Ex: -3 for Argentina time): " - timezone=$REPLY +# note: this can probably be improved by calculating this +# automatically - good for a future iteration +read -rp "Enter your timezone offset (ex: -3 for Argentina time): " + tzoffset=$REPLY sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "$HOME/.noaa.conf" sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "$HOME/.wxtoimgrc" sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/$(echo "$lon * -1" | bc)/g" "$HOME/.predict/predict.qth" -sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g;s/change_tz/$(echo "$timezone * -1" | bc)/g" "sun.py" +sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g;s/change_tz/$(echo "$tzoffset * -1" | bc)/g" "sun.py" success "Install done! Double check your $HOME/.noaa.conf settings"