| … | |
… | |
| 6 | |
6 | |
| 7 | # void iptunnel_depend(void) |
7 | # void iptunnel_depend(void) |
| 8 | # |
8 | # |
| 9 | # Sets up the dependancies for the module |
9 | # Sets up the dependancies for the module |
| 10 | iptunnel_depend() { |
10 | iptunnel_depend() { |
| 11 | after wireless |
|
|
| 12 | before interface |
11 | before interface |
| 13 | functions interface_exists interface_tunnel |
12 | functions interface_exists interface_tunnel |
| 14 | variables iptunnel |
13 | variables iptunnel |
| 15 | } |
14 | } |
| 16 | |
15 | |
| … | |
… | |
| 33 | # |
32 | # |
| 34 | # Removes the device |
33 | # Removes the device |
| 35 | iptunnel_stop() { |
34 | iptunnel_stop() { |
| 36 | local iface="$1" |
35 | local iface="$1" |
| 37 | |
36 | |
|
|
37 | # Don't delete sit0 as it's a special tunnel |
|
|
38 | [[ ${iface} == "sit0" ]] && return 0 |
|
|
39 | |
| 38 | interface_exists "${iface}" || return 0 |
40 | interface_exists "${iface}" || return 0 |
| 39 | [[ -z $( interface_tunnel show "${iface}" 2>/dev/null ) ]] && return 0 |
41 | [[ -z $( interface_tunnel show "${iface}" 2>/dev/null ) ]] && return 0 |
| 40 | |
42 | |
| 41 | ebegin "Destroying tunnel ${iface}" |
43 | ebegin "Destroying tunnel ${iface}" |
| 42 | interface_tunnel del "${iface}" |
44 | interface_tunnel del "${iface}" |