3 |
- |
1 |
#!/bin/bash
|
|
|
2 |
# Copyright (C) 1996-2006 Red Hat, Inc. all rights reserved.
|
|
|
3 |
#
|
|
|
4 |
# This program is free software; you can redistribute it and/or modify
|
|
|
5 |
# it under the terms of the GNU General Public License, version 2,
|
|
|
6 |
# as published by the Free Software Foundation.
|
|
|
7 |
#
|
|
|
8 |
# This program is distributed in the hope that it will be useful,
|
|
|
9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
11 |
# GNU General Public License for more details.
|
|
|
12 |
#
|
|
|
13 |
# You should have received a copy of the GNU General Public License
|
|
|
14 |
# along with this program; if not, write to the Free Software
|
|
|
15 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
|
16 |
|
|
|
17 |
# Thanks to:
|
|
|
18 |
# - Razvan Corneliu C.R. Vilt <razvan.vilt@linux360.ro>
|
|
|
19 |
# - Aaron Hope <aaron.hope@unh.edu>
|
|
|
20 |
# - Sean Millichamp <sean@enertronllc.com>
|
|
|
21 |
# for providing the scripts this one is based on
|
|
|
22 |
|
|
|
23 |
. /etc/init.d/functions
|
|
|
24 |
|
|
|
25 |
cd /etc/sysconfig/network-scripts
|
|
|
26 |
. ./network-functions
|
|
|
27 |
|
|
|
28 |
[ -f ../network ] && . ../network
|
|
|
29 |
|
|
|
30 |
CONFIG=$1
|
|
|
31 |
need_config "$CONFIG"
|
|
|
32 |
source_config
|
|
|
33 |
|
|
|
34 |
# Generic tunnel devices are not supported here
|
|
|
35 |
if [ "$DEVICE" = gre0 -o "$DEVICE" = tunl0 ]; then
|
|
|
36 |
net_log $"Device '$DEVICE' isn't supported as a valid GRE device name."
|
|
|
37 |
exit 1
|
|
|
38 |
fi
|
|
|
39 |
|
|
|
40 |
check_device_down "$DEVICE" && exit 0
|
|
|
41 |
|
|
|
42 |
/sbin/ip link set dev "$DEVICE" down
|
|
|
43 |
/sbin/ip tunnel del "$DEVICE"
|
|
|
44 |
|
|
|
45 |
exec /etc/sysconfig/network-scripts/ifdown-post "$CONFIG"
|