dotfiles

regexghost dotfiles and scripts
git clone https://git.regexghost.com/dotfiles.git
Log | Files | Refs | README

commit 652370e29dfe59b2a743ec403eff56c78d62438e
parent 4e0efa213ee04af6142b2f1a192c5780adb0abff
Author: regexghost <dev@regexghost.com>
Date:   Fri, 17 Jul 2026 19:34:55 +0100

another change to metoffice for POSIX date command

Diffstat:
Mpanel-scripts/metoffice.sh | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/panel-scripts/metoffice.sh b/panel-scripts/metoffice.sh @@ -10,8 +10,13 @@ lat=$(cat "$curLocationFile" | cut -d "|" -f 1) lon=$(cat "$curLocationFile" | cut -d "|" -f 2) geohash=$(geohash $lat $lon 9) today_string="$(date "+%Y-%m-%d")" -tomorrow_string="$(date -d @$(($(date +%s)+86400)) "+%Y-%m-%d")" -second_day_string="$(date -d @$(($(date +%s)+86400+86400)) "+%Y-%m-%d")" +if date --version | grep -q "GNU coreutils"; then + tomorrow_string="$(date -d @$(($(date +%s)+86400)) "+%Y-%m-%d")" + second_day_string="$(date -d @$(($(date +%s)+86400+86400)) "+%Y-%m-%d")" +else + tomorrow_string="$(date -d $(($(date +%s)+86400)) "+%Y-%m-%d")" + second_day_string="$(date -d $(($(date +%s)+86400+86400)) "+%Y-%m-%d")" +fi curl --connect-timeout 5 -s -L "https://weather.metoffice.gov.uk/forecast/$geohash" > "/tmp/panel_i3_data/metoffice.html" # awk instead of grep -A/-B - https://superuser.com/questions/298123/how-to-grep-and-print-the-next-n-lines-after-the-hit/298127#298127