summaryrefslogtreecommitdiff
path: root/bin/update_hosts
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2021-11-27 11:04:34 +0100
committerMarc Vertes <mvertes@free.fr>2021-11-27 11:04:34 +0100
commit7a36b02b5f3ae6560030c97513b8c15d9abd16d8 (patch)
tree5c3a68031aecfab106f50a547f6ba2abaaef4928 /bin/update_hosts
parente27491fbca20c2ecd76fcd84bd7007a546da5a75 (diff)
update
Diffstat (limited to 'bin/update_hosts')
-rwxr-xr-xbin/update_hosts6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/update_hosts b/bin/update_hosts
index 8550ec3..40ec470 100755
--- a/bin/update_hosts
+++ b/bin/update_hosts
@@ -5,11 +5,11 @@
[ "$USER" = root ] || exec sudo "$0" "$@"
-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 '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 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
cd /etc
cp -p hosts hosts.old