ungleich-tools/viirb-cleanup-final-stage.sh
Nico Schottelius d54b383e44 ++viirb
2020-06-14 22:50:43 +02:00

29 lines
505 B
Bash
Executable file

#!/bin/sh
# Nico Schottelius
# 2020-06-14
set -e
set -x
viirb_ip=$1; shift
root_password=$(pwgen -1 32)
cat <<EOF | ssh -t "root@${viirb_ip}"
# Remove temporary IP
uci delete network.lanv4temp
# 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
EOF
echo "Submit to user the root password = ${root_password}"
}