From 35098485bbc9b627ec0281f2cbff4596a8295d6a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 8 Oct 2020 11:42:40 +0200 Subject: [PATCH] fix viirb-1 to use ipv6 literal addresses --- viirb-1-connect-flash-latest-openwrt.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/viirb-1-connect-flash-latest-openwrt.sh b/viirb-1-connect-flash-latest-openwrt.sh index 2d43097..1c69e93 100755 --- a/viirb-1-connect-flash-latest-openwrt.sh +++ b/viirb-1-connect-flash-latest-openwrt.sh @@ -12,6 +12,10 @@ fi set -x dev=$1; shift +# $# = 2 +# shift -> remove the first argument +# $# = 1 + if [ $# -ge 1 ]; then viirb_ip=$1; shift dev="" @@ -42,6 +46,13 @@ cat ~/.ssh/id_rsa.pub | ssh root@${viirb_ip} "cat > /etc/dropbear/authorized_key # Don't re-download if we already have it wget -c http://downloads.openwrt.org/releases/${version}/targets/ramips/mt76x8/${filename} + +if echo $viirb_ip | grep -q :; then + scp_ip="[$viirb_ip]" +else + scp_ip="$viirb_ip" +fi + scp ${filename} root@${viirb_ip}:/tmp ssh root@${viirb_ip} "sysupgrade /tmp/*.bin"