From abdf9f68a665e0e3dfcb7ec7acd20ced90cb8948 Mon Sep 17 00:00:00 2001
From: Tom Herbers <mail@tomherbers.de>
Date: Sun, 1 May 2022 03:23:20 +0200
Subject: [PATCH] contrib/update-images.sh: download multiple branches and
 other dir

---
 contrib/update-images.sh | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/contrib/update-images.sh b/contrib/update-images.sh
index 72735f6..5fb8704 100755
--- a/contrib/update-images.sh
+++ b/contrib/update-images.sh
@@ -1,10 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
-FACTORY="https://firmware.darmstadt.freifunk.net/images/stable/factory/"
-SYSUPGRADE="https://firmware.darmstadt.freifunk.net/images/stable/sysupgrade/"
+set -e
 
-mkdir images
+BASE_URL="https://firmware.darmstadt.freifunk.net/images/"
 
-curl -o images/gluon-factory-example.html "$FACTORY"
-curl -o images/gluon-sysupgrade-example.html "$SYSUPGRADE"
+for BRANCH in "stable" "beta" "testing";
+do
+	echo "updating ${BRANCH}"
 
+	mkdir -p images/${BRANCH}
+
+	curl -sSfo images/${BRANCH}/gluon-factory-example.html "${BASE_URL}${BRANCH}/factory/"
+	curl -sSfo images/${BRANCH}/gluon-other-example.html "${BASE_URL}${BRANCH}/other/"
+	curl -sSfo images/${BRANCH}/gluon-sysupgrade-example.html "${BASE_URL}${BRANCH}/sysupgrade/"
+
+done
-- 
GitLab