Add getNIC ()
This commit is contained in:
parent
e4ddb22032
commit
424b69cd60
1 changed files with 5 additions and 1 deletions
|
|
@ -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 :
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue