Firmware-Update
Aus Freifunk Franken
Achtung dies ist ein Entwurf
sysupgrade von 0.5.x auf aktuelle Firmware
BOARD=$(cat /var/sysinfo/board_name) case "$BOARD" in
tl-wr1043nd) BOARD=tl-wr1043nd-v1 ;; tl-wr741nd) grep "Atheros AR7240 rev 2" /proc/cpuinfo && BOARD=tl-wr741nd-v2 || BOARD=tl-wr741nd-v4 ;; tl-wr741nd-v4) grep 740 /var/sysinfo/model && BOARD=tl-wr740n-v4 ;; tl-wr841n-v7) BOARD=tl-wr841nd-v7 ;; tl-wr841n-v9) grep "v10" /var/sysinfo/model && BOARD=tl-wr841n-v10 ;; nanostation-m) BOARD=ubnt-nano-m ;; tl-wa860re) BOARD=tl-wa860re-v1 ;; tl-wdr3500) BOARD=tl-wdr3500-v1 ;; tl-wdr4300) grep "3600" /var/sysinfo/model && BOARD=tl-wdr3600-v1 grep "4300" /var/sysinfo/model && BOARD=tl-wdr4300-v1 grep "4310" /var/sysinfo/model && BOARD=tl-wdr4310-v1 ;;
esac
case $BOARD in
tl-wdr4900-v1 ) SOC="mpc85xx" ;; * ) SOC="ar71xx" ;;
esac
FILE="fff-20170110-${SOC}-g-${BOARD}-squashfs-sysupgrade.bin"
echo -ne "\nHardware: $BOARD\n" echo -ne "Downloading $FILE\n\n" cd /tmp/ wget [fe80::ff:feee:1%br-mesh]:80/dev/firmware/current/${FILE} wget [fe80::ff:feee:1%br-mesh]:80/dev/firmware/current/${FILE}.md5 echo -ne "\ndone. Comparing md5 sums: " md5sum -c ${FILE}.md5 ret=$? echo if [ $ret -ne 0 ]; then
echo -ne "md5 sums do not match. Try restarting this script to redownload the firmware.\n\n" rm -f ${FILE}* exit 1
else
while true; do read -p "md5 sums correct. Should I start upgrading the firmware (y/N)? " yn case $yn in [Yy] ) echo -ne "\nStarting firmware upgrade. Don't touch me until I reboot.\n\n\n"; sysupgrade ${FILE}; break;; [Nn]|* ) echo -ne "\nAborting firmware upgrade.\n\n"; rm -f ${FILE}*; exit 0;; esac done
fi