#!/bin/sh
# generated for network 'spbansin' @Thu Oct 22 18:11:46 CEST 2020 from ./generate_table.sh
#
# firmware updatemodes:
# - stable..............: r44150
# - beta................: r49276
# - testing/avantgarde..: r4283 (LEDE)
#
# prepare your env with e.g.:
# export PATH="$PATH:~"
# MY_BUILD_DIR=mybuildbot
# sudo mount -t tmpfs -o size=90% none "$PWD/$MY_BUILD_DIR"
# mkdir -p $MY_BUILD_DIR && cd $MY_BUILD_DIR
#
# URL='https://raw.githubusercontent.com/bittorf/kalua/master/openwrt-build/build.sh'
# wget -O build.sh "$URL" && chmod +x build.sh
# ./build.sh --openwrt trunk --download_pool $HOME/openwrt_dl
# ./build.sh --openwrt lede  --download_pool $HOME/openwrt_dl
# scp mysettings /tmp/apply_profile.code.definitions
# scp your_sign_keys .
#
# and copy your public ssh-key (for autouploading files) to: root@intercity-vpn.de
# and execute this script:

export FAILED=

s1() {		# wifimac: 0027222be3d7
	echo; echo '=== next_image: s1 ==='; echo

	cd 'openwrt' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r44150 --feedstime '2015-01-25 23:40' \
		--hardware 'Ubiquiti Bullet M2' --usecase 'Standard,kalua' \
		--release stable 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED s1"
	git stash; test -e 'LICENSE' && cd ..
}

b1() {		# wifimac: 0027222be3d7
	echo; echo '=== next_image: b1 ==='; echo

	cd 'openwrt' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r49276 --feedstime '2016-04-30 16:54' \
		--hardware 'Ubiquiti Bullet M2' --usecase 'Standard,kalua' \
		--release beta 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED b1"
	git stash; test -e 'LICENSE' && cd ..
}

t1() {		# wifimac: 0027222be3d7
	echo; echo '=== next_image: t1 ==='; echo

	cd 'source' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r4283 \
		--hardware 'Ubiquiti Bullet M2' --usecase 'Standard,kalua' \
		--release testing 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED t1"
	git stash; test -e 'LICENSE' && cd ..
}

n1() {		# wifimac: 0027222be3d7
	echo; echo '=== next_image: n1 ==='; echo

	cd 'source' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r$1 \
		--hardware 'Ubiquiti Bullet M2' --usecase 'Standard,kalua' \
		--release nightly 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED n1"
	git stash; test -e 'LICENSE' && cd ..
}

# DEBUG: hardware invalid: 'Ubiquiti Bullet M' - see: 0027222ebccc
# DEBUG: hardware invalid: 'Ubiquiti Bullet M' - see: 0227221c1f34
# DEBUG: hardware invalid: 'Ubiquiti Bullet M' - see: 0227221c1f3c
# DEBUG: hardware invalid: 'Ubiquiti Bullet M' - see: 0227222ae3bf
# DEBUG: hardware invalid: 'Ubiquiti Bullet M' - see: 0227222ae67a
# DEBUG: hardware invalid: 'Ubiquiti Bullet M' - see: 0227222ebc2f
# DEBUG: hardware invalid: 'Ubiquiti Bullet M' - see: 0227222ebcc8
# DEBUG: hardware invalid: 'Ubiquiti Bullet M' - see: 0227222ebcea
# DEBUG: hardware invalid: 'Ubiquiti Bullet M' - see: 0227222ebd9f
s2() {		# wifimac: 4ce676f960bc
	echo; echo '=== next_image: s2 ==='; echo

	cd 'openwrt' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r44150 --feedstime '2015-01-25 23:40' \
		--hardware 'Buffalo WZR-HP-AG300H' --usecase 'Standard,kalua' \
		--release stable 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED s2"
	git stash; test -e 'LICENSE' && cd ..
}

b2() {		# wifimac: 4ce676f960bc
	echo; echo '=== next_image: b2 ==='; echo

	cd 'openwrt' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r49276 --feedstime '2016-04-30 16:54' \
		--hardware 'Buffalo WZR-HP-AG300H' --usecase 'Standard,kalua' \
		--release beta 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED b2"
	git stash; test -e 'LICENSE' && cd ..
}

t2() {		# wifimac: 4ce676f960bc
	echo; echo '=== next_image: t2 ==='; echo

	cd 'source' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r4283 \
		--hardware 'Buffalo WZR-HP-AG300H' --usecase 'Standard,kalua' \
		--release testing 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED t2"
	git stash; test -e 'LICENSE' && cd ..
}

n2() {		# wifimac: 4ce676f960bc
	echo; echo '=== next_image: n2 ==='; echo

	cd 'source' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r$1 \
		--hardware 'Buffalo WZR-HP-AG300H' --usecase 'Standard,kalua' \
		--release nightly 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED n2"
	git stash; test -e 'LICENSE' && cd ..
}

s3() {		# wifimac: 6470025c1b72
	echo; echo '=== next_image: s3 ==='; echo

	cd 'openwrt' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r44150 --feedstime '2015-01-25 23:40' \
		--hardware 'TP-LINK TL-WR1043ND' --usecase 'Standard,kalua' \
		--release stable 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED s3"
	git stash; test -e 'LICENSE' && cd ..
}

b3() {		# wifimac: 6470025c1b72
	echo; echo '=== next_image: b3 ==='; echo

	cd 'openwrt' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r49276 --feedstime '2016-04-30 16:54' \
		--hardware 'TP-LINK TL-WR1043ND' --usecase 'Standard,kalua' \
		--release beta 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED b3"
	git stash; test -e 'LICENSE' && cd ..
}

t3() {		# wifimac: 6470025c1b72
	echo; echo '=== next_image: t3 ==='; echo

	cd 'source' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r4283 \
		--hardware 'TP-LINK TL-WR1043ND' --usecase 'Standard,kalua' \
		--release testing 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED t3"
	git stash; test -e 'LICENSE' && cd ..
}

n3() {		# wifimac: 6470025c1b72
	echo; echo '=== next_image: n3 ==='; echo

	cd 'source' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r$1 \
		--hardware 'TP-LINK TL-WR1043ND' --usecase 'Standard,kalua' \
		--release nightly 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED n3"
	git stash; test -e 'LICENSE' && cd ..
}

s4() {		# wifimac: 687251028b78
	echo; echo '=== next_image: s4 ==='; echo

	cd 'openwrt' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r44150 --feedstime '2015-01-25 23:40' \
		--hardware 'Ubiquiti Bullet M2 Titanium' --usecase 'Standard,kalua' \
		--release stable 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED s4"
	git stash; test -e 'LICENSE' && cd ..
}

b4() {		# wifimac: 687251028b78
	echo; echo '=== next_image: b4 ==='; echo

	cd 'openwrt' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r49276 --feedstime '2016-04-30 16:54' \
		--hardware 'Ubiquiti Bullet M2 Titanium' --usecase 'Standard,kalua' \
		--release beta 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED b4"
	git stash; test -e 'LICENSE' && cd ..
}

t4() {		# wifimac: 687251028b78
	echo; echo '=== next_image: t4 ==='; echo

	cd 'source' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r4283 \
		--hardware 'Ubiquiti Bullet M2 Titanium' --usecase 'Standard,kalua' \
		--release testing 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED t4"
	git stash; test -e 'LICENSE' && cd ..
}

n4() {		# wifimac: 687251028b78
	echo; echo '=== next_image: n4 ==='; echo

	cd 'source' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r$1 \
		--hardware 'Ubiquiti Bullet M2 Titanium' --usecase 'Standard,kalua' \
		--release nightly 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED n4"
	git stash; test -e 'LICENSE' && cd ..
}

s5() {		# wifimac: b0487abb5042
	echo; echo '=== next_image: s5 ==='; echo

	cd 'openwrt' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r44150 --feedstime '2015-01-25 23:40' \
		--hardware 'TP-LINK TL-WR1043ND' --usecase 'Standard,VDS,kalua' \
		--release stable 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED s5"
	git stash; test -e 'LICENSE' && cd ..
}

b5() {		# wifimac: b0487abb5042
	echo; echo '=== next_image: b5 ==='; echo

	cd 'openwrt' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r49276 --feedstime '2016-04-30 16:54' \
		--hardware 'TP-LINK TL-WR1043ND' --usecase 'Standard,VDS,kalua' \
		--release beta 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED b5"
	git stash; test -e 'LICENSE' && cd ..
}

t5() {		# wifimac: b0487abb5042
	echo; echo '=== next_image: t5 ==='; echo

	cd 'source' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r4283 \
		--hardware 'TP-LINK TL-WR1043ND' --usecase 'Standard,VDS,kalua' \
		--release testing 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED t5"
	git stash; test -e 'LICENSE' && cd ..
}

n5() {		# wifimac: b0487abb5042
	echo; echo '=== next_image: n5 ==='; echo

	cd 'source' && git checkout 'master' && test -e '.config' && rm -fR bin/ && make clean || true && \
	../build.sh \
		--buildid 'firmware@bittorf-wireless.com' \
		--openwrt r$1 \
		--hardware 'TP-LINK TL-WR1043ND' --usecase 'Standard,VDS,kalua' \
		--release nightly 'root@intercity-vpn.de:/var/www/networks/spbansin' || FAILED="$FAILED n5"
	git stash; test -e 'LICENSE' && cd ..
}

# DEBUG: hardware invalid: 'Ubiquiti Bullet M' - see: dc9fdb02f8d1
# DEBUG: hardware invalid: 'Ubiquiti Bullet M' - see: de9fdb309429
stable() {
	s1;s2;s3;s4;s5;
}

beta() {
	b1;b2;b3;b4;b5;
}

testing() {
	t1;t2;t3;t4;t5;
}

nightly() {
	n1;n2;n3;n4;n5;
}

all() { stable; beta; testing; }

update() { wget -O build_all.sh http://intercity-vpn.de/networks/spbansin/firmware/build_all.sh; }

# overall stable + beta + testing: 5 + 5 + 5 = 15 images
# already build: 0 images
# still needed: 15 images
#
# START: Thu Oct 22 18:11:46 CEST 2020
# READY: Thu Oct 22 18:11:46 CEST 2020
