1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

/usr/bin/iiab-support: tun0 IP visible upfront

This commit is contained in:
root 2021-08-25 08:47:45 -04:00
parent 9053abcfc9
commit 18838157eb

View file

@ -55,17 +55,21 @@ if $($DEBUG); then
echo -e "/etc/iiab/local_vars.yml shows:\n"
grep "^openvpn_" /etc/iiab/local_vars.yml
echo
echo "Your OpenVPN machine name -- source: $handle"
echo "Your OpenVPN machine name--direct from source: $handle"
fi
# Preview of steps (5) and (6)
echo -ne "\e[1mYour OpenVPN machine name is set to: \e[100m"
# echo -ne "\e[1mYour OpenVPN machine name is set to: \e[100m"
echo -ne "Your OpenVPN machine name (openvpn_handle) is: \e[32m"
echo -n "$handle" | sed "s/^\(['\"]\)\(.*\)\1$/\2/; s/ /_/g" # Avoid '-e' interpreting backlash escapes, to show var accurately! Double quote var to prevent field splitting (eats spaces)
echo -e "\e[0m\n" # Separate line also for trailing backslash in var
echo -e "\e[0m" # Separate line also for trailing backslash in var
vpnip=$(ip a | grep tun0$ | awk '{print $2}')
echo -e "Your OpenVPN IP address (which can change) is: \e[32m$vpnip\e[0m\n"
echo -e "\e[1mPlease type a descriptive OpenVPN machine name (openvpn_handle) such as:\n"
echo -e " cape-town-school-36-rpi-2019-05-31\n"
echo -e " cape-town-school-36-rpi-2021-09-01\n"
echo -en "Or hit [Enter] to keep the existing name:\e[0m "
read ans < /dev/tty # Strips outer whitespace, whether we like it or not!