[viirb] modify to go through in mostly one step

This commit is contained in:
Nico Schottelius 2021-08-02 17:23:26 +02:00
parent 2e60bbe9d0
commit 9965032008
3 changed files with 18 additions and 28 deletions

View file

@ -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

View file

@ -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 <<EOF | ssh -t "root@${viirb_ip}"
# cat <<EOF | ssh -t "root@${viirb_ip}"
ping -c5 ungleich.ch || exit 1
# update the sources
@ -222,4 +210,3 @@ reboot
EOF
echo "Wireguard public key and id: ${id} ${public_key}"
echo ${public_key} > ${viirb_hostname}.public_key

View file

@ -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}"