Add getNIC ()

This commit is contained in:
Angristan 2018-08-19 01:03:35 +02:00
parent e4ddb22032
commit 424b69cd60

View file

@ -81,6 +81,10 @@ function initialCheck () {
checkOS checkOS
} }
function getNIC () {
return $(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)
}
function newclient () { function newclient () {
echo "" echo ""
echo "Do you want to protect the configuration file with a password?" echo "Do you want to protect the configuration file with a password?"
@ -152,7 +156,7 @@ function newclient () {
initialCheck initialCheck
# Get Internet network interface with default route # Get Internet network interface with default route
NIC=$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1) NIC=$(getNIC)
if [[ -e /etc/openvpn/server.conf ]]; then if [[ -e /etc/openvpn/server.conf ]]; then
while : while :