aboutsummaryrefslogtreecommitdiffstats
path: root/network-scripts/ifdown-bnep
blob: 59201fd93740b702df8b5780bb9da20e2b20c6d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#! /bin/bash

. /etc/init.d/functions

cd /etc/sysconfig/network-scripts
. ./network-functions

[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network

CONFIG=${1}

source_config

# On hotplug events, just bring the virtual device up as if it's normal Ethernet
if [ -n "$IN_HOTPLUG" ]; then
    exec /etc/sysconfig/network-scripts/ifdown-eth ${CONFIG} $2
fi

stop_panu()
{
    kill -TERM $(cat /run/pand-${DEVICE}.pid)
}

stop_nap()
{
    kill -TERM $(cat /run/pand-${DEVICE}.pid)
    /usr/bin/pand -K
}

stop_gn()
{
    :
}

case "$ROLE" in
PANU)
    stop_panu
    ;;
NAP)
    stop_nap
    ;;
GN)
    stop_gn
    ;;
*)
    echo Unknown BNEP mode :$ROLE
    ;;
esac