|
Lines 66-77
Link Here
|
| 66 |
# Set the base metric to 1000 |
66 |
# Set the base metric to 1000 |
| 67 |
metric=1000 |
67 |
metric=1000 |
| 68 |
|
68 |
|
| 69 |
if [[ -x /usr/sbin/openvpn ]] ; then |
69 |
if [[ -x /usr/bin/tunctl ]] ; then |
| 70 |
openvpn --mktun --dev-type "${!tuntap}" --dev "${iface}" \ |
|
|
| 71 |
> /dev/null |
| 72 |
else |
| 73 |
local opts="tunctl_${ifvar}" |
70 |
local opts="tunctl_${ifvar}" |
| 74 |
tunctl ${!opts} -t "${iface}" >/dev/null |
71 |
tunctl ${!opts} -t "${iface}" >/dev/null |
|
|
72 |
else |
| 73 |
openvpn --mktun --dev-type "${!tuntap}" --dev "${iface}" \ |
| 74 |
> /dev/null |
| 75 |
fi |
75 |
fi |
| 76 |
eend $? && save_options tuntap "${!tuntap}" |
76 |
eend $? && save_options tuntap "${!tuntap}" |
| 77 |
} |
77 |
} |
|
Lines 86-97
Link Here
|
| 86 |
tuntap_exists "${iface}" || return 0 |
86 |
tuntap_exists "${iface}" || return 0 |
| 87 |
|
87 |
|
| 88 |
ebegin "Destroying Tun/Tap interface ${iface}" |
88 |
ebegin "Destroying Tun/Tap interface ${iface}" |
| 89 |
if [[ -x /usr/sbin/openvpn ]] ; then |
89 |
if [[ -x /usr/bin/tunctl ]] ; then |
|
|
90 |
tunctl -d "${iface}" >/dev/null |
| 91 |
else |
| 90 |
openvpn --rmtun \ |
92 |
openvpn --rmtun \ |
| 91 |
--dev-type "$(get_options tuntap)" \ |
93 |
--dev-type "$(get_options tuntap)" \ |
| 92 |
--dev "${iface}" > /dev/null |
94 |
--dev "${iface}" > /dev/null |
| 93 |
else |
|
|
| 94 |
tunctl -d "${iface}" >/dev/null |
| 95 |
fi |
95 |
fi |
| 96 |
eend $? |
96 |
eend $? |
| 97 |
} |
97 |
} |