diff options
author | Bill Nottingham <notting@redhat.com> | 2003-05-28 18:53:50 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2003-05-28 18:53:50 +0000 |
commit | e956fb172d00dc564cc50f2a33a0feb9ddd53839 (patch) | |
tree | 8316038834ff51a4d745dd867b4535ca94ea94b5 /sysconfig/network-scripts/ifup | |
parent | 515094b273406277de12adc648846435e27ce389 (diff) | |
download | initscripts-e956fb172d00dc564cc50f2a33a0feb9ddd53839.tar initscripts-e956fb172d00dc564cc50f2a33a0feb9ddd53839.tar.gz initscripts-e956fb172d00dc564cc50f2a33a0feb9ddd53839.tar.bz2 initscripts-e956fb172d00dc564cc50f2a33a0feb9ddd53839.tar.xz initscripts-e956fb172d00dc564cc50f2a33a0feb9ddd53839.zip |
- make usernetctl use the nickname instead of the device name
- don't look in /etc/sysconfig/networking
- fix calling of nameif before the device was loaded
- clean up route handling
(<harald@redhat.com>)
Diffstat (limited to 'sysconfig/network-scripts/ifup')
-rwxr-xr-x | sysconfig/network-scripts/ifup | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index e1d655b3..4cb7fd67 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -15,7 +15,6 @@ cd /etc/sysconfig/network-scripts . network-functions [ -f ../network ] && . ../network -[ -f ../networking/network ] && . ../networking/network CONFIG=${1} @@ -35,8 +34,8 @@ need_config ${CONFIG} if [ ${UID} != 0 ]; then if [ -x /usr/sbin/usernetctl ]; then source_config - if /usr/sbin/usernetctl ${DEVICE} report ; then - exec /usr/sbin/usernetctl ${DEVICE} up + if /usr/sbin/usernetctl ${CONFIG} report ; then + exec /usr/sbin/usernetctl ${CONFIG} up fi fi echo $"Users cannot control this device." >&2 @@ -135,7 +134,7 @@ if [ "${BOOTPROTO}" = "bootp" -o "${BOOTPROTO}" = "dhcp" ]; then fi if [ -x /sbin/ifup-pre-local ]; then - /sbin/ifup-pre-local ${DEVICE} + /sbin/ifup-pre-local ${CONFIG} $2 fi OTHERSCRIPT="/etc/sysconfig/network-scripts/ifup-${DEVICETYPE}" @@ -144,6 +143,24 @@ if [ -x ${OTHERSCRIPT} ]; then exec ${OTHERSCRIPT} ${CONFIG} $2 fi +# load the module associated with that device +# /sbin/modprobe ${REALDEVICE} +is_available ${REALDEVICE} + +# remap, if the device is bound with a MAC address and not the right device num +# bail out, if the MAC does not fit +if [ -n "${HWADDR}" ]; then + FOUNDMACADDR=`LC_ALL= LANG= ip -o link show ${REALDEVICE} | \ + sed 's/.*link\/ether \([[:alnum:]:]*\).*/\1/'` + if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then + /sbin/nameif "${REALDEVICE}" "${HWADDR}" || { + echo $"Device ${DEVICE} has different MAC address than expected, ignoring." + exit 1 + } + fi +fi + +# now check the real state is_available ${REALDEVICE} || { if [ "$?" = "1" ] ; then echo $"$alias device ${DEVICE} does not seem to be present, delaying initialization." @@ -152,16 +169,6 @@ is_available ${REALDEVICE} || { exit 0 fi } -if [ -n "${HWADDR}" ]; then - FOUNDMACADDR=`LC_ALL= LANG= ip -o link show ${REALDEVICE} | \ - sed 's/.*link\/ether \([[:alnum:]:]*\).*/\1/'` - if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then - /sbin/nameif "${REALDEVICE}" "${HWADDR}" || { - echo $"Device ${DEVICE} has different MAC address than expected, ignoring." - exit 1 - } - fi -fi # is the device wireless? If so, configure wireless device specifics is_wireless_device ${DEVICE} && . ./ifup-wireless |