Merge branch 'master' of code.ungleich.ch:ungleich-public/ungleich-tools

This commit is contained in:
Nico Schottelius 2021-08-04 15:20:49 +02:00
commit 57d3771399
3 changed files with 18 additions and 28 deletions

View File

@ -3,8 +3,8 @@
# See https://ungleich.ch/u/products/viirb-ipv6-box/ # See https://ungleich.ch/u/products/viirb-ipv6-box/
if [ $# -ne 1 ]; then if [ $# -ne 1 ]; then
echo "$0 interface [address]" echo "$0 address"
echo " address: connect to this address, ignore the interface" echo " address: connect to this address"
exit 1 exit 1
fi fi
@ -13,7 +13,7 @@ set -x
viirb_ip=$1; shift viirb_ip=$1; shift
# openwrt # openwrt
version=19.07.6 version=19.07.7
filename=openwrt-${version}-ramips-mt76x8-vocore2-squashfs-sysupgrade.bin filename=openwrt-${version}-ramips-mt76x8-vocore2-squashfs-sysupgrade.bin
# don't care about other/old known_host entries # 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 # Ensure it is not disabled
uci delete wireless.radio0.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 uci commit
# Need to reboot to restore /etc/resolv.conf # This should not be needed, as we connect directly to the dynamic IPv4
reboot # /etc/init.d/network restart
#/etc/init.d/network restart # # ensure viirb is back
EOF # # 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 # # change to ipv6
# ensure viirb network is up and running - bridge takes a bit of time # viirb_ip=${my_lan_ip}
# 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 # ping -c5 ${viirb_ip}
viirb_ip=${my_lan_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 ping -c5 ungleich.ch || exit 1
# update the sources # update the sources
@ -222,4 +210,3 @@ reboot
EOF EOF
echo "Wireguard public key and id: ${id} ${public_key}" 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 # Setup root password
printf "${root_password}\n${root_password}\n" | passwd printf "${root_password}\n${root_password}\n" | passwd
# Ensure everything's good
reboot
EOF EOF
echo "Submit to user the root password = ${root_password}" echo "Submit to user the root password = ${root_password}"