Lines 57-62
Link Here
|
57 |
tuntap_pre_start() { |
57 |
tuntap_pre_start() { |
58 |
local iface="$1" ifvar=$(bash_variable "$1") |
58 |
local iface="$1" ifvar=$(bash_variable "$1") |
59 |
local tuntap="tuntap_${ifvar}" |
59 |
local tuntap="tuntap_${ifvar}" |
|
|
60 |
local opts="tunctl_${ifvar}" |
60 |
|
61 |
|
61 |
[[ -z ${!tuntap} ]] && return 0 |
62 |
[[ -z ${!tuntap} ]] && return 0 |
62 |
tuntap_check_kernel || return 1 |
63 |
tuntap_check_kernel || return 1 |
Lines 65-76
Link Here
|
65 |
|
66 |
|
66 |
# Set the base metric to 1000 |
67 |
# Set the base metric to 1000 |
67 |
metric=1000 |
68 |
metric=1000 |
68 |
|
69 |
|
69 |
if [[ -x /usr/sbin/openvpn ]] ; then |
70 |
if [[ -z "${!opts}" ]] && [[ -x /usr/sbin/openvpn ]] ; then |
70 |
openvpn --mktun --dev-type "${!tuntap}" --dev "${iface}" \ |
71 |
openvpn --mktun --dev-type "${!tuntap}" --dev "${iface}" \ |
71 |
> /dev/null |
72 |
> /dev/null |
72 |
else |
73 |
else |
73 |
local opts="tunctl_${ifvar}" |
|
|
74 |
tunctl ${!opts} -t "${iface}" >/dev/null |
74 |
tunctl ${!opts} -t "${iface}" >/dev/null |
75 |
fi |
75 |
fi |
76 |
eend $? && save_options tuntap "${!tuntap}" |
76 |
eend $? && save_options tuntap "${!tuntap}" |