Revision 2573,
1.2 KB
checked in by daisuke, 14 years ago
(diff) |
fix bash3ism
- bash4's source (or .) command does not search current directory any longer.
|
Rev | Line | |
---|
[1108] | 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 | |
---|
| 13 | cd /etc/sysconfig/network-scripts |
---|
[2573] | 14 | . /etc/sysconfig/network-scripts/network-functions |
---|
[1108] | 15 | |
---|
| 16 | . /etc/sysconfig/network |
---|
| 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 ${GATEWAY} 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 ${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 |
---|
| 39 | done |
---|
| 40 | |
---|
| 41 | if [ "${NETWORK}" != "" ] ; then |
---|
| 42 | route add -host ${GATEWAY} metric 1 ${DEVICE} |
---|
| 43 | fi |
---|
| 44 | |
---|
| 45 | if [ "${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 |
---|
| 50 | fi |
---|
| 51 | |
---|
| 52 | /etc/sysconfig/network-scripts/ifup-post $1 |
---|
Note: See
TracBrowser
for help on using the repository browser.