source: projects/initscripts/tags/initscripts-8.91.0/sysconfig/network-scripts/ifdown @ 2576

Revision 2576, 977 bytes checked in by daisuke, 13 years ago (diff)

tagging as initscripts-8.91.0

Line 
1#!/bin/bash
2
3unset WINDOW # defined by screen, conflicts with our usage
4
5. /etc/init.d/functions
6
7cd /etc/sysconfig/network-scripts
8. /etc/sysconfig/network-scripts/network-functions
9
10[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
11
12CONFIG=$1
13
14[ -z "$CONFIG" ] && {
15    echo $"usage: ifdown <device name>" >&2
16    exit 1
17}
18
19need_config $CONFIG
20
21[ -f "$CONFIG" ] || {
22    echo $"usage: ifdown <device name>" >&2
23    exit 1
24}
25
26if [ $UID != 0 ]; then
27    if [ -x /usr/sbin/usernetctl ]; then
28        source_config
29        if /usr/sbin/usernetctl ${CONFIG} report ; then
30            exec /usr/sbin/usernetctl ${CONFIG} down
31        fi
32    fi
33    echo $"Users cannot control this device." >&2
34    exit 1
35fi
36
37source_config
38
39if [ -x /sbin/ifdown-pre-local ]; then
40    /sbin/ifdown-pre-local ${DEVICE}
41fi
42
43OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-${DEVICETYPE}"
44
45if [ ! -x ${OTHERSCRIPT} ]; then
46    OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-eth"
47fi
48
49exec ${OTHERSCRIPT} ${CONFIG} $2
Note: See TracBrowser for help on using the repository browser.