aboutsummaryrefslogtreecommitdiffstats
path: root/download
diff options
context:
space:
mode:
authorrubo77 <github@r.z11.de>2018-07-20 01:58:43 +0200
committerrubo77 <github@r.z11.de>2018-07-20 13:26:13 +0200
commit708fb5979da91615c6fcdea82b3e4c4536f13173 (patch)
tree6c3b6889e636b6569023c3952f9d42d877bc01ec /download
parentda7a04ba759998ce3ae1ed1a5b77e2e5fc88dd97 (diff)
add firmware indexer script
Diffstat (limited to 'download')
-rwxr-xr-xdownload/upgrade-downloadpage.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/download/upgrade-downloadpage.sh b/download/upgrade-downloadpage.sh
new file mode 100755
index 0000000..b9aba2d
--- /dev/null
+++ b/download/upgrade-downloadpage.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+# set the new release-candidate version here
+CUR=2018.1~exp-215
+OUT_FILE=index.html
+wget -k --no-check-certificate http://freifunk.in-kiel.de/firmware-rc.html -O $OUT_FILE
+# replace the data from the template
+sed -i 's|/.*/sysupgrade/gluon-ffki-<VERSION>|/release-candidate/sysupgrade/gluon-ffki-'$CUR'|g' $OUT_FILE
+sed -i 's|/.*/factory/gluon-ffki-<VERSION>|/release-candidate/factory/gluon-ffki-'$CUR'|g' $OUT_FILE
+echo -n "dead link check "
+#sed -i "s/tube2/nixtube2/g" $OUT_FILE # for debug to create a dead link
+INVALID='">n/a</a><deadlink none="'
+while IFS= read -r URL; do
+ if wget --no-check-certificate --spider "$URL" 2>/dev/null; then
+ echo -n .
+ else
+ echo
+ echo "$URL does not exist"
+ sed -i 's|'$URL'|'$URL''$INVALID'|g' $OUT_FILE
+ fi
+#done < <(grep -Po '(?<=href=")[^"]*' $OUT_FILE|grep gluon|grep alfa) # for debug
+done < <(grep -Po '(?<=href=")[^"]*' $OUT_FILE|grep gluon)
+echo "dead link check done"