/[vps]/baselayout-vserver/trunk/net-scripts/net.modules.d/iptunnel
Gentoo

Contents of /baselayout-vserver/trunk/net-scripts/net.modules.d/iptunnel

Parent Directory Parent Directory | Revision Log Revision Log


Revision 236 - (show annotations) (download)
Tue Feb 14 13:00:44 2006 UTC (8 years, 8 months ago) by phreak
File size: 1080 byte(s)
Merging r1881
1 #!/bin/bash
2 # Copyright (c) 2004-2005 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 # Contributed by Roy Marples (uberlord@gentoo.org)
6
7 # void iptunnel_depend(void)
8 #
9 # Sets up the dependancies for the module
10 iptunnel_depend() {
11 before interface
12 functions interface_exists interface_tunnel
13 variables iptunnel
14 }
15
16 # bool iptunnel_pre_start(char *iface)
17 #
18 # Create the device, give it the right perms
19 iptunnel_pre_start() {
20 local iface="$1" opts ifvar=$( bash_variable "$1" )
21
22 # Get our options
23 eval opts="iptunnel_${ifvar}"
24 [[ -z ${!opts} ]] && return 0
25
26 ebegin "Creating tunnel ${iface}"
27 interface_tunnel add "${iface}" ${!opts}
28 eend "$?"
29 }
30
31 # bool iptunnel_stop(char *iface)
32 #
33 # Removes the device
34 iptunnel_stop() {
35 local iface="$1"
36
37 # Don't delete sit0 as it's a special tunnel
38 [[ ${iface} == "sit0" ]] && return 0
39
40 interface_exists "${iface}" || return 0
41 [[ -z $( interface_tunnel show "${iface}" 2>/dev/null ) ]] && return 0
42
43 ebegin "Destroying tunnel ${iface}"
44 interface_tunnel del "${iface}"
45 eend "$?"
46 }
47
48 # vim:ts=4

  ViewVC Help
Powered by ViewVC 1.1.20