|
|
|
@ -13,9 +13,8 @@ set -x
|
|
|
|
|
viwib_ip=$1; shift
|
|
|
|
|
|
|
|
|
|
# openwrt
|
|
|
|
|
version=21.02.3
|
|
|
|
|
filename=openwrt-${version}-ath79-nand-glinet_gl-ar300m-nor-squashfs-sysupgrade.bin
|
|
|
|
|
url=https://downloads.openwrt.org/releases/${version}/targets/ath79/nand
|
|
|
|
|
version=22.03.3
|
|
|
|
|
filename=openwrt-${version}-ramips-mt76x8-glinet_gl-mt300n-v2-squashfs-sysupgrade.bin
|
|
|
|
|
|
|
|
|
|
# don't care about other/old known_host entries
|
|
|
|
|
ssh-keygen -R ${viwib_ip}
|
|
|
|
@ -27,9 +26,8 @@ done
|
|
|
|
|
|
|
|
|
|
cat ~/.ssh/id_rsa.pub | ssh root@${viwib_ip} "cat > /etc/dropbear/authorized_keys"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Don't re-download if we already have it
|
|
|
|
|
wget -c ${url}/${filename}
|
|
|
|
|
wget -c http://downloads.openwrt.org/releases/${version}/targets/ramips/mt76x8/${filename}
|
|
|
|
|
|
|
|
|
|
if echo $viwib_ip | grep -q :; then
|
|
|
|
|
scp_ip="[$viwib_ip]"
|
|
|
|
@ -37,7 +35,7 @@ else
|
|
|
|
|
scp_ip="$viwib_ip"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
scp ${filename} root@${scp_ip}:/tmp
|
|
|
|
|
scp -O ${filename} root@${scp_ip}:/tmp
|
|
|
|
|
ssh root@${viwib_ip} "sysupgrade -n /tmp/*.bin"
|
|
|
|
|
|
|
|
|
|
# It still pings for some time - wait for the reboot to happen
|