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

Revision 2576, 1.2 KB checked in by daisuke, 13 years ago (diff)

tagging as initscripts-8.91.0

Line 
1#!/bin/bash
2#
3# /etc/sysconfig/network-scripts/ifup-ctc
4#
5# the ctc network driver is a point-to-point driver on S/390 machines
6#
7# To get the ctc module to load automatically at boot, you will need to
8# add the following line to /etc/modprobe.conf:
9#
10# alias ctc0 ctc
11#
12
13cd /etc/sysconfig/network-scripts
14. /etc/sysconfig/network-scripts/network-functions
15
16. /etc/sysconfig/network
17
18CONFIG=$1
19[ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG
20source_config
21
22if [ "$2" = "boot" -a "${ONBOOT}" = "no" ]
23then
24        exit
25fi
26[ -n "${MTU}" ] && opts="${opts} mtu ${MTU}"
27
28ifconfig ${DEVICE} ${IPADDR} ${opts} pointopoint ${GATEWAY} netmask ${NETMASK}
29
30# Wait for the device to come up - the chandev'ified ctc driver can take
31# quite a while...
32timeout=0
33while ! ping -w 30 -c 1 ${GATEWAY} &>/dev/null; do
34        timeout=$(($timeout + 1))
35        if [ $timeout = 20 ]; then
36                echo $"ERROR: ${DEVICE} did not come up!"
37                break
38        fi
39done
40
41if [ "${NETWORK}" != "" ] ; then
42        route add -host ${GATEWAY} metric 1 ${DEVICE}
43fi
44
45if [ "${GATEWAY}" != "" ]; then
46        if [ "${GATEWAYDEV}" = "" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then
47                # set up default gateway
48                route add default gw ${GATEWAY} ${METRIC:+metric $METRIC}
49        fi
50fi
51
52/etc/sysconfig/network-scripts/ifup-post $1
Note: See TracBrowser for help on using the repository browser.