From b5bfa659d79895d3217377aea14ff14eb31a6319 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Wed, 31 Aug 2022 23:36:21 +0200 Subject: update --- bin/update_hosts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/update_hosts b/bin/update_hosts index 40ec470..74bf25b 100755 --- a/bin/update_hosts +++ b/bin/update_hosts @@ -7,9 +7,11 @@ echo 'Checking from https://github.com/StevenBlack/hosts:' lsd=$(curl -s 'https://api.github.com/repos/StevenBlack/hosts/commits?path=hosts&page=1&per_page=1' | jq -r '.[0].commit.committer.date') -echo "last source update: $(date -j -f "%FT%TZ" "$lsd")" +#echo "last source update: $(date -j -f "%FT%TZ" "$lsd")" +echo "last source update: $(date --date="$lsd")" echo "last local update: $(date -r /etc/hosts)" -[ $(date -j -f "%FT%TZ" "$lsd" +%s) -lt $(date -r /etc/hosts +%s) ] && echo 'Nothing to do' && exit +# [ $(date -j -f "%FT%TZ" "$lsd" +%s) -lt $(date -r /etc/hosts +%s) ] && echo 'Nothing to do' && exit +[ $(date --date="$lsd" +%s) -lt $(date -r /etc/hosts +%s) ] && echo 'Nothing to do' && exit cd /etc cp -p hosts hosts.old -- cgit v1.2.3