summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@iiso>2011-10-12 13:00:44 +0200
committertv <tv@iiso>2011-10-12 13:00:44 +0200
commit8b1827f42d3d8a967b9a385bbb048835e1792872 (patch)
tree456f6dce9cda4d4238a8843ae68a9652f82797f3
parent9c2721f58f6ec9c271dd16f2bf0ddc054f24f403 (diff)
//retiolum super-...: inline hrefs
-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