Commit f3647964 authored by Jondy Zhao's avatar Jondy Zhao

No check devcon/cscript when tap has been installed;

Add publish=yes when adding route.
parent 62333501
...@@ -324,10 +324,8 @@ function install_tap_driver() ...@@ -324,10 +324,8 @@ function install_tap_driver()
{ {
local FILENAME="/etc/openvpn/driver/OemWin2k.inf" local FILENAME="/etc/openvpn/driver/OemWin2k.inf"
local DEVFILE=$(cygpath -w $FILENAME) local DEVFILE=$(cygpath -w $FILENAME)
local DEVCON=$(which devcon.exe)
local HWID=tap0901 local HWID=tap0901
local CHECKSCRIPT=$(cygpath -m /etc/openvpn/check_driver_signing_dialog.vbs) local CHECKSCRIPT=$(cygpath -m /etc/openvpn/check_driver_signing_dialog.vbs)
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 # check if ifname has been installed
...@@ -344,11 +342,13 @@ function install_tap_driver() ...@@ -344,11 +342,13 @@ function install_tap_driver()
return 1 return 1
fi fi
local DEVCON=$(which devcon.exe)
if [[ ! -x $DEVCON ]] ; then if [[ ! -x $DEVCON ]] ; then
echo "Error: no devcon.exe found" echo "Error: no devcon.exe found"
return 1 return 1
fi fi
local CSCRIPT=$(which cscript.exe)
if [[ ! -x $CSCRIPT ]] ; then if [[ ! -x $CSCRIPT ]] ; then
echo "Error: no cscript.exe found" echo "Error: no cscript.exe found"
return 1 return 1
...@@ -425,7 +425,7 @@ function uninstall_tap_driver() ...@@ -425,7 +425,7 @@ function uninstall_tap_driver()
local DEVCON=$(which devcon.exe) local DEVCON=$(which devcon.exe)
local CSCRIPT=$(which cscript.exe) local CSCRIPT=$(which cscript.exe)
local GETSCRIPT=$(cygpath -m /etc/openvpn/get_pnpid_connection.vbs) local GETSCRIPT=$(cygpath -m /etc/openvpn/get_pnpid_connection.vbs)
if [[ "$1" == "" ]] ; then if [[ "$1" == "" ]] ; then
echo "Error: missing connection name" echo "Error: missing connection name"
return 1 return 1
...@@ -721,7 +721,7 @@ elif [[ $object == "route" ]] ; then ...@@ -721,7 +721,7 @@ elif [[ $object == "route" ]] ; then
if [[ "$opt_family" == "ipv4" || "$opt_family" == "" ]] ; then if [[ "$opt_family" == "ipv4" || "$opt_family" == "" ]] ; then
# rtmroute need that the Routing and Remote Access Service is running # rtmroute need that the Routing and Remote Access Service is running
ipcmd="netsh routing ip $command rtmroute" # ipcmd="netsh routing ip $command rtmroute"
# ipcmd="netsh routing ip $command persistentroute" # ipcmd="netsh routing ip $command persistentroute"
if [[ $command == "list" ]] ; then if [[ $command == "list" ]] ; then
route print route print
...@@ -733,12 +733,14 @@ elif [[ $object == "route" ]] ; then ...@@ -733,12 +733,14 @@ elif [[ $object == "route" ]] ; then
mask=$(prefix_to_netmask $(basename $prefix)) mask=$(prefix_to_netmask $(basename $prefix))
ipcmd="route $command $address MASK $mask $nexthop" ipcmd="route $command $address MASK $mask $nexthop"
elif [[ "$opt_family" == "ipv6" ]] ; then elif [[ "$opt_family" == "ipv6" ]] ; then
if [[ $command == "list" ]] ; then if [[ $command == "add" ]] ; then
publish="publish=yes"
elif [[ $command == "list" ]] ; then
command="show" command="show"
elif [[ $command == "change" ]] ; then elif [[ $command == "change" ]] ; then
command="set" command="set"
fi fi
ipcmd="netsh interface ipv6 $command route $prefix \"$interface\" $nexthop" ipcmd="netsh interface ipv6 $command route $prefix \"$interface\" $nexthop $publish"
else else
echo $orig_cmd echo $orig_cmd
echo "Error: unsupported family \"$opt_family\"" echo "Error: unsupported family \"$opt_family\""
......
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