init tuto2: don't save the token before validating it

This commit is contained in:
nemunaire 2019-03-15 18:26:12 +01:00
parent 5ba8ccc0df
commit 58b939a61b

View File

@ -113,7 +113,6 @@ files:
echo -n "You didn't define your token to connect the network. Please copy it here now: "
read WGTOKEN
}
echo -n "${WGTOKEN}" > etc/adlin.token
/sbin/sysctl -w net.ipv6.conf.eth0.autoconf=0
/bin/ip link set up dev eth0
/bin/busybox udhcpc -n -q
@ -130,6 +129,8 @@ files:
echo "Sorry, I was unable to establish a connection to adlin.nemunai.re."
echo "Please verify that your primary network interface can obtain an IPv4 through DHCP."
echo ""
echo "If curl report a 400 error, then you probably mistyped the token, you should reboot now."
echo ""
echo "Dropping to a shell, please fix your network, then press Ctrl+D or exit to retry."
echo ""
echo "****************************************"
@ -137,6 +138,7 @@ files:
/bin/busybox cttyhack /usr/sbin/chroot . /bin/sh
echo "Retrying connection..."
done
echo -n "${WGTOKEN}" > etc/adlin.token
/sbin/modprobe wireguard
/bin/ip link add dev wg0 type wireguard
/usr/bin/wg setconf wg0 etc/wireguard/adlin.conf