summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xretiolum/bin/supernode-update-hosts-and-hup8
1 files changed, 5 insertions, 3 deletions
diff --git a/retiolum/bin/supernode-update-hosts-and-hup b/retiolum/bin/supernode-update-hosts-and-hup
index b1ce3489..221a7538 100755
--- a/retiolum/bin/supernode-update-hosts-and-hup
+++ b/retiolum/bin/supernode-update-hosts-and-hup
@@ -3,16 +3,18 @@ set -euf
cd /etc/tinc/retiolum/hosts
-painload="$(dirname "$(readlink -f "$0")")/../.."
-
temp1="`mktemp`"
temp2="`mktemp`"
trap "rm -f $temp1 $temp2" EXIT INT TERM
old_commit="`cat .commit 2>/dev/null || :`"
+_hrefs() {
+ sed -n 's/href="\([^"]\+\)"/\n&\n/gp' |
+ sed -n 's/^href="\([^"]\+\)"$/\1/p'; }
+
curl -fsS "https://github.com/krebscode/painload/tree/master/retiolum/hosts" |
- "$painload/util/bin/hrefs" |
+ _hrefs |
grep '^/krebscode/painload/blob/' |
grep -v "/blob/$old_commit/" >$temp1