ungleich-tools/viirb-cleanup-final-stage.sh

30 lines
505 B
Bash
Raw Normal View History

#!/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}"
}