2020-12-21 19:24:52 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Nico Schottelius
|
|
|
|
# 2020-12-21
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
if [ $# -ne 2 ]; then
|
|
|
|
echo "$0 vigir-ip-address vigir-id"
|
|
|
|
echo " vigir-ip-address: where to find the vigir"
|
|
|
|
echo " vigir-id: number in decimal format"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
vigir_ip=$1; shift
|
|
|
|
|
|
|
|
id=$1; shift
|
|
|
|
vigir_hostname=vigir${id}
|
|
|
|
|
|
|
|
root_password=$(pwgen -1 32)
|
|
|
|
|
|
|
|
cat <<EOF | ssh -t "root@${vigir_ip}"
|
|
|
|
# Remove temporary IP
|
|
|
|
|
|
|
|
# Correct test SSID to final one
|
|
|
|
uci set wireless.default_radio0.ssid='IPv6 everywhere'
|
2020-12-22 07:54:49 +00:00
|
|
|
uci set wireless.default_radio1.ssid='IPv6 everywhere 5Ghz'
|
|
|
|
|
2020-12-21 19:24:52 +00:00
|
|
|
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
|
|
|
|
|
2021-11-16 13:17:22 +00:00
|
|
|
printf "${root_password}\n${root_password}\n" | pass insert vigir/vigir${id}
|
|
|
|
pass git push
|
|
|
|
|
2020-12-21 19:24:52 +00:00
|
|
|
echo "Submit to user the root password = ${root_password}"
|