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