diff options
author | Bill Nottingham <notting@redhat.com> | 2003-06-24 03:10:47 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2003-06-24 03:10:47 +0000 |
commit | a9405effe269ad57346b215b8c881189333b190f (patch) | |
tree | 22557995418230a1c548d5d4fb48403171f5e1f3 /sysconfig | |
parent | 4de90482aada4f5c152d6faa35066723ab0544ae (diff) | |
download | initscripts-a9405effe269ad57346b215b8c881189333b190f.tar initscripts-a9405effe269ad57346b215b8c881189333b190f.tar.gz initscripts-a9405effe269ad57346b215b8c881189333b190f.tar.bz2 initscripts-a9405effe269ad57346b215b8c881189333b190f.tar.xz initscripts-a9405effe269ad57346b215b8c881189333b190f.zip |
support randomly named network devices, part 1
- use nameif
- determine device type from file first, and from device name as a
fallback
- ditto for aliases
Diffstat (limited to 'sysconfig')
-rwxr-xr-x | sysconfig/network-scripts/ifdown | 2 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifdown-post | 2 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup | 9 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-post | 8 | ||||
-rw-r--r-- | sysconfig/network-scripts/network-functions | 38 |
5 files changed, 37 insertions, 22 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown index 9493a24c..4e490f68 100755 --- a/sysconfig/network-scripts/ifdown +++ b/sysconfig/network-scripts/ifdown @@ -38,8 +38,6 @@ if [ -x /sbin/ifdown-pre-local ]; then /sbin/ifdown-pre-local ${DEVICE} fi -DEVICETYPE=`echo $DEVICE | sed "s/[0-9]*$//"` -[ -z "$REALDEVICE" ] && REALDEVICE=`echo ${DEVICE} | sed 's/:.*//g'` OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-${DEVICETYPE}" if [ -x $OTHERSCRIPT ]; then diff --git a/sysconfig/network-scripts/ifdown-post b/sysconfig/network-scripts/ifdown-post index 66ea3bdf..b78399ee 100755 --- a/sysconfig/network-scripts/ifdown-post +++ b/sysconfig/network-scripts/ifdown-post @@ -8,8 +8,6 @@ cd /etc/sysconfig/network-scripts CONFIG=$1 source_config -DEVICETYPE=`echo $DEVICE | sed "s/[0-9]*$//"` - if [ "${DEVICETYPE}" = "ppp" -o "${DEVICETYPE}" = "ippp" ]; then if [ -f /etc/resolv.conf.save ]; then cat /etc/resolv.conf.save > /etc/resolv.conf diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index 4cb7fd67..f20af64d 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -53,15 +53,6 @@ then exit 0 fi -# figure out more about what we are dealing with -DEVICETYPE=`echo ${DEVICE} | sed "s/[0-9]*$//"` -[ -z "$REALDEVICE" ] && REALDEVICE=${DEVICE%%:*} -if [ "${DEVICE}" != "${REALDEVICE}" ]; then - ISALIAS=yes -else - ISALIAS=no -fi - # Ethernet 802.1Q VLAN support if [ -x /sbin/vconfig -a "${VLAN}" = "yes" ]; then if echo ${DEVICE} | LANG=C egrep -v '(:)' | LANG=C egrep -q 'eth[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?' ; then diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post index 39dbad59..401d1e8c 100755 --- a/sysconfig/network-scripts/ifup-post +++ b/sysconfig/network-scripts/ifup-post @@ -8,14 +8,6 @@ cd /etc/sysconfig/network-scripts CONFIG=$1 source_config -DEVICETYPE=`echo $DEVICE | sed "s/[0-9]*$//"` -REALDEVICE=`echo $DEVICE | sed 's/:.*//g'` -if echo $DEVICE | grep -q ':' ; then - ISALIAS=yes -else - ISALIAS=no -fi - if [ "$ISALIAS" = no ] ; then /etc/sysconfig/network-scripts/ifup-aliases ${DEVICE} ${CONFIG} fi diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index d8c03a6e..eb2d0efc 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -27,8 +27,44 @@ source_config () . $PARENTCONFIG fi . $CONFIG + case "$TYPE" in + Ethernet) + DEVICETYPE="eth" + ;; + CIPE) + DEVICETYPE="cipcb" + ;; + Modem) + DEVICETPYE="ppp" + ;; + ISDN) + DEVICETYPE="ippp" + ;; + Wireless) + DEVICETYPE="eth" + ;; + "Token Ring") + DEVICETYPE="eth" + ;; + CTC) + DEVICETYPE="ctc" + ;; + IUCV) + DEVICETYPE="iucv" + ;; + esac + [ -z "$DEVICETYPE" ] && DEVICETYPE=`echo ${DEVICE} | sed "s/[0-9]*$//"` + [ -z "$REALDEVICE" -a -n "$PARENTDEVICE" ] && REALDEVICE=$PARENTDEVICE + [ -z "$REALDEVICE" ] && REALDEVICE=${DEVICE%%:*} + if [ "${DEVICE}" != "${REALDEVICE}" ]; then + ISALIAS=yes + else + ISALIAS=no + fi } + + expand_config () { if [ -z "${NETMASK}" ]; then @@ -87,7 +123,7 @@ is_available () return 2 fi modprobe $1 > /dev/null 2>&1 || return 1 - + [ -n "$HWADDR" ] && /sbin/nameif "$1" "$HWADDR" LC_ALL= LANG= ip -o link | grep -q $1 return $? } |