[viwib] updates
This commit is contained in:
parent
02ea7054b1
commit
5eb3a5d1fe
3 changed files with 47 additions and 13 deletions
|
@ -180,12 +180,6 @@ uci set firewall.@zone[1].network='wan wan6 wg0'
|
||||||
|
|
||||||
uci commit
|
uci commit
|
||||||
|
|
||||||
# Remove our ssh keys
|
|
||||||
rm -f /etc/dropbear/authorized_keys
|
|
||||||
|
|
||||||
# Setup root password
|
|
||||||
printf "${root_password}\n${root_password}\n" | passwd
|
|
||||||
|
|
||||||
reboot
|
reboot
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -202,3 +196,7 @@ while ! ping -c5 ${viwib_ip}; do
|
||||||
echo "Waiting for viwib ${id}"
|
echo "Waiting for viwib ${id}"
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "Wireguard public key and id: ${id} ${public_key}"
|
||||||
|
echo "Root password: ${root_password}"
|
||||||
|
echo ${public_key} > ${viwib_hostname}.public_key
|
||||||
|
|
|
@ -64,13 +64,7 @@ while [ $i -lt 10 ]; do
|
||||||
done
|
done
|
||||||
|
|
||||||
i=0
|
i=0
|
||||||
while [ $i -lt 10 ]; do
|
while [ $i -lt 30 ]; do
|
||||||
ping -c1 ${my_lan_ip} && break
|
ping -c1 ${my_lan_ip} && break
|
||||||
i=$((i+1))
|
i=$((i+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
i=0
|
|
||||||
while [ $i -lt 10 ]; do
|
|
||||||
ping -c1 ${my_wifi_ip} && break
|
|
||||||
i=$((i+1))
|
|
||||||
done
|
|
||||||
|
|
42
openwrt/viwib-4-cleanup.sh
Executable file
42
openwrt/viwib-4-cleanup.sh
Executable file
|
@ -0,0 +1,42 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Nico Schottelius
|
||||||
|
# 2020-06-14
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
echo "$0 viwib-ip-address viwib-id"
|
||||||
|
echo " viwib-ip-address: where to find the viwib"
|
||||||
|
echo " viwib-id: number in decimal format"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
viwib_ip=$1; shift
|
||||||
|
|
||||||
|
id=$1; shift
|
||||||
|
viwib_hostname=viwib${id}
|
||||||
|
|
||||||
|
root_password=$(pwgen -1 32)
|
||||||
|
|
||||||
|
# Save for sending to user
|
||||||
|
# FIXME: future make this more easy / better to transfer
|
||||||
|
echo $root_password > ${viwib_hostname}.rootpw
|
||||||
|
|
||||||
|
cat <<EOF | ssh -t "root@${viwib_ip}"
|
||||||
|
# Remove temporary IP
|
||||||
|
|
||||||
|
# Correct test SSID to final one
|
||||||
|
uci set wireless.default_radio0.ssid='IPv6 everywhere'
|
||||||
|
uci commit
|
||||||
|
|
||||||
|
# Remove our ssh keys
|
||||||
|
rm -f /etc/dropbear/authorized_keys
|
||||||
|
|
||||||
|
# Setup root password
|
||||||
|
printf "${root_password}\n${root_password}\n" | passwd
|
||||||
|
|
||||||
|
reboot
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "Submit to user the root password = ${root_password}"
|
Loading…
Reference in a new issue