From 3284a5f2f53d0441cdaab58db16b1bfdd9973acd Mon Sep 17 00:00:00 2001 From: angristan Date: Mon, 17 Sep 2018 14:59:48 +0200 Subject: [PATCH] Move newClient and installLocalDNS to functions --- openvpn-install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 8b610bd..f4e41ae 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -21,7 +21,7 @@ function tunAvailable () { fi } -function checkOS() { +function checkOS () { if [[ -e /etc/debian_version ]]; then OS="debian" # Getting the version number, to verify that a recent version of OpenVPN is available @@ -78,10 +78,6 @@ function initialCheck () { checkOS } -# Main - -initialCheck - function newclient () { echo "" echo "Do you want to protect the configuration file with a password?" @@ -221,6 +217,10 @@ private-address: ::ffff:0:0/96' > /etc/unbound/openvpn.conf fi } +# Main + +initialCheck + # Get Internet network interface with default route NIC=$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)