]> git.pld-linux.org Git - projects/rc-scripts.git/blob - sysconfig/network-scripts/tnldown
- is_yes and is_no cleanups
[projects/rc-scripts.git] / sysconfig / network-scripts / tnldown
1 #!/bin/sh
2 #
3 #       $Id: tnldown,v 1.15 2000/06/12 08:38:15 waszi Exp $
4 #
5 # Author: Arkadiusz Mi¶kiewicz <misiek@pld.org.pl>
6 #
7
8 DEV=$1
9
10 [ -z "$DEV" ] && {
11     echo "usage: tnlup <device name>" >&2
12     exit 1
13 }
14
15 . /etc/sysconfig/network-scripts/.functions
16 . /etc/sysconfig/network
17
18 TNLCONFIGS="`ls /etc/sysconfig/interfaces/tnlcfg-*|egrep -v '~$'`"
19 TNLCONFIGS="`egrep -L '^#!' $TNLCONFIGS`"
20 CONFIG="`egrep -l "^DEVICE=[\"\']*$DEV[\"\']*\$" $TNLCONFIGS`"
21
22 if [ -z "$CONFIG" ]; then
23     CONFIG="$DEV"
24 fi
25
26 if false; then
27 [ -f "/etc/sysconfig/interfaces/$CONFIG" ] || CONFIG=tnlcfg-$CONFIG
28 [ -f "/etc/sysconfig/interfaces/$CONFIG" ] || {
29     echo "usage: tnlup <device name>" >&2
30     exit 1
31 }
32 fi
33
34 source_config
35
36 is_no "${IPV6_TUNNELCONFIG}" && [ "${MODE}" = "sit" ] && exit 0
37 is_no "${IPX}" && [ "${MODE}" = "ipxip" ] && exit 0
38 is_no "${IPX}" && [ "${MODE}" = "ipipx" ] && exit 0
39
40 if [ "${MODE}" = "ipip" ] || [ "${MODE}" = "sit" ] || [ "${MODE}" = "gre" ]; then
41
42         ip tunnel del ${DEVICE}
43
44 elif [ "${MODE}" = "ipxip" ] || [ "${MODE}" = "ipipx" ]; then
45
46 echo "obs³uga ipxip jeszcze nie zrobiona"
47
48 fi
This page took 0.027283 seconds and 4 git commands to generate.