1 | #!/bin/sh |
---|
2 | # |
---|
3 | # ipv6-down |
---|
4 | # |
---|
5 | # Called by pppd after IPV6CP/down was finished |
---|
6 | # |
---|
7 | # This file should not be modified -- make local changes to |
---|
8 | # /etc/ppp/ipv6-down.local instead |
---|
9 | # |
---|
10 | # |
---|
11 | # Taken from: |
---|
12 | # (P) & (C) 2001-2006 by Peter Bieringer <pb@bieringer.de> |
---|
13 | # |
---|
14 | # You will find more information on the initscripts-ipv6 homepage at |
---|
15 | # http://www.deepspace6.net/projects/initscripts-ipv6.html |
---|
16 | # |
---|
17 | # RHL integration assistance by Pekka Savola <pekkas@netcore.fi> |
---|
18 | # |
---|
19 | # Calling parameters: |
---|
20 | # $1: interface name |
---|
21 | # $6: logical interface name (set by pppd option ipparam) |
---|
22 | # |
---|
23 | # Version 2006-08-02 |
---|
24 | # |
---|
25 | # Uses following information from /etc/sysconfig/network-scripts/ifcfg-$1: |
---|
26 | # IPV6INIT=yes|no: controls IPv6 configuration for this interface |
---|
27 | # |
---|
28 | |
---|
29 | |
---|
30 | PATH=/sbin:/usr/sbin:/bin:/usr/bin |
---|
31 | export PATH |
---|
32 | |
---|
33 | LOGDEVICE=$6 |
---|
34 | REALDEVICE=$1 |
---|
35 | |
---|
36 | [ -f /etc/sysconfig/network ] || exit 0 |
---|
37 | . /etc/sysconfig/network |
---|
38 | |
---|
39 | cd /etc/sysconfig/network-scripts |
---|
40 | . ./network-functions |
---|
41 | |
---|
42 | CONFIG=$LOGDEVICE |
---|
43 | [ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG |
---|
44 | source_config |
---|
45 | |
---|
46 | [ -f /etc/sysconfig/network-scripts/network-functions-ipv6 ] || exit 1 |
---|
47 | . /etc/sysconfig/network-scripts/network-functions-ipv6 |
---|
48 | |
---|
49 | [ -x /etc/ppp/ipv6-down.local ] && /etc/ppp/ipv6-down.local "$@" |
---|
50 | |
---|
51 | |
---|
52 | if [ "$IPV6_CONTROL_RADVD" = "yes" ]; then |
---|
53 | # Control running radvd |
---|
54 | ipv6_trigger_radvd down "$IPV6_RADVD_TRIGGER_ACTION" $IPV6_RADVD_PIDFILE |
---|
55 | fi |
---|
56 | |
---|
57 | # IPv6 test, no module loaded, exit if system is not IPv6-ready |
---|
58 | ipv6_test testonly || exit 0 |
---|
59 | |
---|
60 | # Test device status |
---|
61 | ipv6_test_device_status $REALDEVICE |
---|
62 | if [ $? != 0 -a $? != 11 ]; then |
---|
63 | # device doesn't exist or other problem occurs |
---|
64 | exit 1 |
---|
65 | fi |
---|
66 | |
---|
67 | # Delete all current configured IPv6 addresses on this interface |
---|
68 | ipv6_cleanup_device $REALDEVICE |
---|
69 | |
---|
70 | exit 0 |
---|