Commit 199fa0b1 authored by Jondy Zhao's avatar Jondy Zhao

Fix ip script, do nothing if tap-driver has been installed.

parent 296bbc27
...@@ -330,6 +330,15 @@ function install_tap_driver() ...@@ -330,6 +330,15 @@ function install_tap_driver()
local CSCRIPT=$(which cscript) local CSCRIPT=$(which cscript)
local GETSCRIPT=$(cygpath -m /etc/openvpn/get_last_connection.vbs) local GETSCRIPT=$(cygpath -m /etc/openvpn/get_last_connection.vbs)
# check if ifname has been installed
if [[ ! "$1" == "" ]] ; then
netsh interface show interface | grep -q "\\b$1\\b"
if (( $? == 0 )) ; then
echo "Nothing need to do, \"$1\" has been installed."
return 0
fi
fi
if [[ ! -f $FILENAME ]] ; then if [[ ! -f $FILENAME ]] ; then
echo "Error: no TAP-WINDOWS driver inf file found" echo "Error: no TAP-WINDOWS driver inf file found"
return 1 return 1
...@@ -396,6 +405,7 @@ EOF ...@@ -396,6 +405,7 @@ EOF
WScript.Quit(0) WScript.Quit(0)
EOF EOF
fi fi
# nodosfilewarning
local OLDNAME=$($CSCRIPT //Nologo $GETSCRIPT) local OLDNAME=$($CSCRIPT //Nologo $GETSCRIPT)
if (( $? == 0 )) ; then if (( $? == 0 )) ; then
netsh interface set interface name="$OLDNAME" newname="$1" netsh interface set interface name="$OLDNAME" newname="$1"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment