Add script for firmware update on gl inet microuter n300
This commit is contained in:
parent
307761fcc7
commit
24521e82dd
2 changed files with 41 additions and 0 deletions
2
openwrt/.gitignore
vendored
Normal file
2
openwrt/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*.rootpw
|
||||
*.public_key
|
39
openwrt/microuter-n300-firmware-upgrade.sh
Executable file
39
openwrt/microuter-n300-firmware-upgrade.sh
Executable file
|
@ -0,0 +1,39 @@
|
|||
#!/bin/sh
|
||||
# 2022-01-20, Nico Schottelius
|
||||
# See https://ungleich.ch/u/products/device-ipv6-box/
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "$0 address"
|
||||
echo " address: connect to this address"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -x
|
||||
|
||||
device_ip=$1; shift
|
||||
|
||||
# openwrt
|
||||
version=21.02.0
|
||||
filename=openwrt-${version}-ramips-mt76x8-glinet_microuter-n300-squashfs-sysupgrade.bin
|
||||
|
||||
# don't care about other/old known_host entries
|
||||
ssh-keygen -R ${device_ip}
|
||||
|
||||
while ! ping -c1 ${device_ip}; do
|
||||
echo "Cannot ping $device_ip yet - waiting"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
cat ~/.ssh/id_rsa.pub | ssh root@${device_ip} "cat > /etc/dropbear/authorized_keys"
|
||||
|
||||
# Don't re-download if we already have it
|
||||
wget -c http://downloads.openwrt.org/releases/${version}/targets/ramips/mt76x8/${filename}
|
||||
|
||||
if echo $device_ip | grep -q :; then
|
||||
scp_ip="[$device_ip]"
|
||||
else
|
||||
scp_ip="$device_ip"
|
||||
fi
|
||||
|
||||
scp ${filename} root@${scp_ip}:/tmp
|
||||
ssh root@${device_ip} "sysupgrade -n /tmp/*.bin"
|
Loading…
Reference in a new issue