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

Friendlier UX, now also output your openvpn_handle & tun0 IP address

This commit is contained in:
A Holt 2019-05-09 19:12:30 -04:00 committed by GitHub
parent 397c71c698
commit 93b19d677a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,16 +12,22 @@ if [ ! -f $PLAYBOOK ]; then
exit 1
fi
echo -en "\nWhat OpenVPN machine name do you want? "
echo -en "\n\nWhat OpenVPN machine name (openvpn_handle) do you want? "
read ans < /dev/tty
if [ "$ans" != "" ]; then
sed -i -e "s/^openvpn_handle:.*/openvpn_handle: $ans/" /etc/iiab/local_vars.yml
echo -e "\nYour machine's openvpn_handle will now be set... \n"
echo -e "\nYour machine's openvpn_handle is now set, in /etc/iiab/local_vars.yml\n"
else
echo -e "\nWARNING: your machine's openvpn_handle will remain unchanged...\n"
echo -e "\nWARNING: openvpn_handle remains unchanged in /etc/iiab/local_vars.yml\n"
fi
sed -i -e "s/^openvpn_install:.*/openvpn_install: True/" /etc/iiab/local_vars.yml
sed -i -e "s/^openvpn_enabled:.*/openvpn_enabled: True/" /etc/iiab/local_vars.yml
echo -e "Now let's (re)install and activate OpenVPN...\n"
ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local
echo -en "\nYour OpenVPN handle is....... "
cat /etc/iiab/openvpn_handle
echo -e "\nYour OpenVPN IP address is... $(ip a | grep tun0$ | awk '{print $2}')\n\n"