#!/bin/sh # Nico Schottelius, 2022-01-26 # https://wiki.teltonika-networks.com/view/Firmware_upgrade_via_command_line # https://wiki.teltonika-networks.com/view/RUT240_Firmware_Downloads if [ $# -ne 1 ]; then echo "$0 address" echo " address: connect to this address (often: 192.168.1.1)" exit 1 fi set -x filename=RUT2_R_00.07.01.2_WEBUI.bin device_ip=$1; shift while ! ping -c1 ${device_ip}; do echo "Cannot ping $device_ip yet - waiting" sleep 1 done if echo $device_ip | grep -q :; then scp_ip="[$device_ip]" else scp_ip="$device_ip" fi wget -c https://wiki.teltonika-networks.com/wikibase/images/8/85/${filename} scp ${filename} root@${scp_ip}:/tmp ssh root@${device_ip} "sysupgrade -n /tmp/*.bin"