From 996503200879da110832f57dde7b4a5b8d211cec Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 2 Aug 2021 17:23:26 +0200 Subject: [PATCH] [viirb] modify to go through in mostly one step --- openwrt/viirb-1-firmware-upgrade.sh | 6 ++--- openwrt/viirb-2-configure.sh | 37 ++++++++++------------------- openwrt/viirb-4-cleanup.sh | 3 +++ 3 files changed, 18 insertions(+), 28 deletions(-) diff --git a/openwrt/viirb-1-firmware-upgrade.sh b/openwrt/viirb-1-firmware-upgrade.sh index 786e6da..b65e331 100755 --- a/openwrt/viirb-1-firmware-upgrade.sh +++ b/openwrt/viirb-1-firmware-upgrade.sh @@ -3,8 +3,8 @@ # See https://ungleich.ch/u/products/viirb-ipv6-box/ if [ $# -ne 1 ]; then - echo "$0 interface [address]" - echo " address: connect to this address, ignore the interface" + echo "$0 address" + echo " address: connect to this address" exit 1 fi @@ -13,7 +13,7 @@ set -x viirb_ip=$1; shift # openwrt -version=19.07.6 +version=19.07.7 filename=openwrt-${version}-ramips-mt76x8-vocore2-squashfs-sysupgrade.bin # don't care about other/old known_host entries diff --git a/openwrt/viirb-2-configure.sh b/openwrt/viirb-2-configure.sh index 093d547..3524045 100755 --- a/openwrt/viirb-2-configure.sh +++ b/openwrt/viirb-2-configure.sh @@ -120,36 +120,24 @@ uci set dhcp.wifi.dynamicdhcp='0' # Ensure it is not disabled uci delete wireless.radio0.disabled -# This is temporary - keeping it until the config process is through -# Probably not needet - we can connect to the final IPv6 address! -# This code commented out == The address vanishes due to above reconfiguration -# uci set network.lanv4temp=interface -# uci set network.lanv4temp.proto='static' -# uci set network.lanv4temp.ifname='br-lan' -# uci set network.lanv4temp.ipaddr='192.168.61.1' -# uci set network.lanv4temp.netmask='255.255.255.0' - uci commit -# Need to reboot to restore /etc/resolv.conf -reboot +# This should not be needed, as we connect directly to the dynamic IPv4 +# /etc/init.d/network restart -#/etc/init.d/network restart -EOF +# # ensure viirb is back +# # ensure viirb network is up and running - bridge takes a bit of time +# # ensure viirb gives out ipv6 address +# # Found: 30s is not enough for full reconfiguration +# echo "Public VPN key: ${id} ${public_key}" +# sleep 60 -# ensure viirb is back -# ensure viirb network is up and running - bridge takes a bit of time -# ensure viirb gives out ipv6 address -# Found: 30s is not enough for full reconfiguration -echo "Public VPN key: ${id} ${public_key}" -sleep 60 +# # change to ipv6 +# viirb_ip=${my_lan_ip} -# change to ipv6 -viirb_ip=${my_lan_ip} +# ping -c5 ${viirb_ip} -ping -c5 ${viirb_ip} - -cat < ${viirb_hostname}.public_key diff --git a/openwrt/viirb-4-cleanup.sh b/openwrt/viirb-4-cleanup.sh index a9a116a..77916b8 100755 --- a/openwrt/viirb-4-cleanup.sh +++ b/openwrt/viirb-4-cleanup.sh @@ -36,6 +36,9 @@ rm -f /etc/dropbear/authorized_keys # Setup root password printf "${root_password}\n${root_password}\n" | passwd + +# Ensure everything's good +reboot EOF echo "Submit to user the root password = ${root_password}"