#!/bin/sh
# generated for network 'palais' @Thu Oct 22 18:07:37 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: 30b5c2566a1e
	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 'TP-LINK TL-WDR4300' --usecase 'Standard,kalua' \
		--release stable 'root@intercity-vpn.de:/var/www/networks/palais' || FAILED="$FAILED s1"
	git stash; test -e 'LICENSE' && cd ..
}

b1() {		# wifimac: 30b5c2566a1e
	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 'TP-LINK TL-WDR4300' --usecase 'Standard,kalua' \
		--release beta 'root@intercity-vpn.de:/var/www/networks/palais' || FAILED="$FAILED b1"
	git stash; test -e 'LICENSE' && cd ..
}

t1() {		# wifimac: 30b5c2566a1e
	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 'TP-LINK TL-WDR4300' --usecase 'Standard,kalua' \
		--release testing 'root@intercity-vpn.de:/var/www/networks/palais' || FAILED="$FAILED t1"
	git stash; test -e 'LICENSE' && cd ..
}

n1() {		# wifimac: 30b5c2566a1e
	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 'TP-LINK TL-WDR4300' --usecase 'Standard,kalua' \
		--release nightly 'root@intercity-vpn.de:/var/www/networks/palais' || FAILED="$FAILED n1"
	git stash; test -e 'LICENSE' && cd ..
}

stable() {
	s1;
}

beta() {
	b1;
}

testing() {
	t1;
}

nightly() {
	n1;
}

all() { stable; beta; testing; }

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

# overall stable + beta + testing: 1 + 1 + 1 = 3 images
# already build: 0 images
# still needed: 3 images
#
# START: Thu Oct 22 18:07:37 CEST 2020
# READY: Thu Oct 22 18:07:37 CEST 2020
