Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > d3d351de73522253e7b8cc0849487f4b > files > 25

isdn4k-utils-3.2-71.fc13.src.rpm

#!/bin/bash
# Network Interface Configuration System
# Copyright (c) 1996-2002 Red Hat, Inc. all rights reserved.
#
# This software may be freely redistributed under the terms of the GNU
# public license.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

. /etc/init.d/functions

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

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

CONFIG=${1}

[ -z "${CONFIG}" ] && {
    echo $"Usage: isdndial <device name>" >&2
    exit 1
}

need_config ${CONFIG}

[ -f "${CONFIG}" ] || {
    echo $"$0: configuration for ${1} not found." >&2
    echo $"Usage: isdndial <device name>" >&2
    exit 1
}

[ -x /sbin/ifup ] || {
    echo $"/sbin/ifup does not exist" >&2
    exit 1
}

[ -x /sbin/isdnctrl ] || {
    echo $"/sbin/isdnctrl does not exist" >&2
    exit 1
}

if [ ${UID} != 0 ]; then
    if [ -x /usr/sbin/userisdnctl ]; then
        source_config
        if /usr/sbin/userisdnctl ${CONFIG} report ; then
            exec /usr/sbin/userisdnctl ${CONFIG} dial
        fi
    fi
    echo $"Users cannot control this device." >&2
    exit 1
fi

source_config

/sbin/ifdown ${CONFIG}
sleep 2

/sbin/ifup ${CONFIG} || exit 1
sleep 2

/sbin/isdnctrl dial ${DEVICE} && sleep 4