Replace ifconfig.* occurrencies with ifcfg- to comply with RedHat and NetworkManager ifcfg-rh plugin

This commit is contained in:
silvan 2011-04-27 20:06:31 +02:00
parent b7ef6814a6
commit f95a4b2984
4 changed files with 31 additions and 27 deletions

View File

@ -1,3 +1,7 @@
Changes in version 1.2.4 <silvan.calarco@mambasoft.it> 20110427
- network: replace ifconfig.* occurencies with ifcfg- to comply with RedHat and NetworkManager ifcfg-rh plugin
---------------------------------------------------------------------------------
Changes in version 1.2.3 <silvan.calarco@mambasoft.it> 20110319 Changes in version 1.2.3 <silvan.calarco@mambasoft.it> 20110319
- sound: don't reprobe when no (PCI) soundcards are available - sound: don't reprobe when no (PCI) soundcards are available
--------------------------------------------------------------------------------- ---------------------------------------------------------------------------------

View File

@ -131,9 +131,11 @@ dist: clean
echo "ChangeLog not updated; not releasing" 1>&2;\ echo "ChangeLog not updated; not releasing" 1>&2;\
exit 1;; \ exit 1;; \
esac esac
@mkdir /tmp/$(distdir)
@cp -a * /tmp/$(distdir)/
@rm -f $(dist_archive);\ @rm -f $(dist_archive);\
tar cf - --exclude=$(PACKAGE)*.bz2 -C .. $(distdir) |\ tar cf - -C /tmp $(distdir) | bzip2 -9 -c > $(dist_archive)
bzip2 -9 -c > $(dist_archive) @rm -rf /tmp/$(distdir)
@echo "file \`$(dist_archive)' created" @echo "file \`$(dist_archive)' created"
dist-rpm: dist dist-rpm: dist

View File

@ -1 +1 @@
VERSION = 1.2.3 VERSION = 1.2.4

View File

@ -3,7 +3,7 @@
# network - network plugin for postplug # network - network plugin for postplug
# #
# Copyright (c) 2004-2007 by Davide Madrisan <davide.madrisan@qilinux.it> # Copyright (c) 2004-2007 by Davide Madrisan <davide.madrisan@qilinux.it>
# Copyright (c) 2009 by Silvan Calarco <silvan.calarco@mambasoft.it> # Copyright (c) 2009-2011 by Silvan Calarco <silvan.calarco@mambasoft.it>
# #
if [ $UID != 0 ]; then if [ $UID != 0 ]; then
@ -30,11 +30,11 @@ function wlan_config_auto() {
local wlan_interface="$1" local wlan_interface="$1"
cat > $network_devices/ifconfig.${wlan_interface} << _EOF cat > $network_devices/ifcfg-${wlan_interface} << _EOF
IF=${wlan_interface} DEVICE=${wlan_interface}
BOOTPROTO=dhcp BOOTPROTO=dhcp
ZONE=local
ONBOOT=yes ONBOOT=yes
#NM_CONTROLLED=no
#WIRELESS_ESSID="" #WIRELESS_ESSID=""
#WIRELESS_MODE=managed #WIRELESS_MODE=managed
#WIRELESS_ENC=s:ENCRYPTIONKEY #WIRELESS_ENC=s:ENCRYPTIONKEY
@ -48,17 +48,16 @@ function eth_config_auto() {
local eth_interface="$1" local eth_interface="$1"
cat > $network_devices/ifconfig.${eth_interface} << _EOF cat > $network_devices/ifcfg-${eth_interface} << _EOF
IF=${eth_interface} DEVICE=${eth_interface}
BOOTPROTO=dhcp BOOTPROTO=dhcp
ZONE=local
ONBOOT=yes ONBOOT=yes
#NM_CONTROLLED=no
_EOF _EOF
} }
# FIXME : add support for 'ZONE=$IF_ZONE'
function eth_config() { function eth_config() {
# eth_config {--enable|--disable|--auto} <int_name> # eth_config {--enable|--disable|--auto} <int_name>
@ -93,8 +92,8 @@ function eth_config() {
unset IF_IPADDR IF_NETMASK IF_NETWORK IF_BROADCAST DEST_GATEWAY_IF unset IF_IPADDR IF_NETMASK IF_NETWORK IF_BROADCAST DEST_GATEWAY_IF
if [ "$action" = "disable" ]; then if [ "$action" = "disable" ]; then
cat > $network_devices/ifconfig.${eth_interface} << _EOF cat > $network_devices/ifcfg-${eth_interface} << _EOF
IF=${eth_interface} DEVICE=${eth_interface}
ONBOOT=no ONBOOT=no
_EOF _EOF
return return
@ -109,9 +108,8 @@ $dialog_backtitle -- "$"Network devices configuration" \
# configure DHCP for this interface # configure DHCP for this interface
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
#unset IF_ZONE cat > $network_devices/ifcfg-${eth_interface} << _EOF
cat > $network_devices/ifconfig.${eth_interface} << _EOF DEVICE=${eth_interface}
IF=${eth_interface}
BOOTPROTO=dhcp BOOTPROTO=dhcp
ZONE=local ZONE=local
ONBOOT=yes ONBOOT=yes
@ -150,14 +148,14 @@ $dialog_backtitle -- "$"Network interface configuration" \
break break
fi fi
done done
cat > $network_devices/ifconfig.${eth_interface} << _EOF cat > $network_devices/ifcfg-${eth_interface} << _EOF
IF=${eth_interface} DEVICE=${eth_interface}
ONBOOT=yes ONBOOT=yes
ZONE=local
IPADDR=$IF_IPADDR IPADDR=$IF_IPADDR
NETWORK=$IF_NETWORK NETWORK=$IF_NETWORK
NETMASK=$IF_NETMASK NETMASK=$IF_NETMASK
BROADCAST=$IF_BROADCAST BROADCAST=$IF_BROADCAST
#NM_CONTROLLED=no
_EOF _EOF
fi fi
} }
@ -232,8 +230,8 @@ _EOF
echo "nameserver 127.0.0.1" >> $resolv_conf echo "nameserver 127.0.0.1" >> $resolv_conf
fi fi
(cd /etc/sysconfig/network-devices/ && (cd /etc/sysconfig/$network_devices/ &&
for sysconfile in $(ls ifconfig.* 2>/dev/null); do for sysconfile in $(ls ifcfg-* 2>/dev/null); do
. $sysconfile . $sysconfile
# configure the default gateway using the first # configure the default gateway using the first
# interface not configured with DHCP # interface not configured with DHCP
@ -256,7 +254,7 @@ for wlan_int in $(cat /proc/net/wireless 2>/dev/null | sed -n '/[a-z]*[0-9]*:/{s
/sbin/ifconfig $wlan_int >/dev/null 2>&1 || continue /sbin/ifconfig $wlan_int >/dev/null 2>&1 || continue
# found interface already configured # found interface already configured
[ -e $network_devices/ifconfig.$wlan_int ] && continue [ -e $network_devices/ifcfg-$wlan_int ] && continue
wlan_ints[${#wlan_ints[*]}]="$wlan_int" wlan_ints[${#wlan_ints[*]}]="$wlan_int"
echo "$wlan_int" >> $postplugnew_file 2>/dev/null echo "$wlan_int" >> $postplugnew_file 2>/dev/null
@ -268,7 +266,7 @@ for eth_int in $(cat /proc/net/dev | sed -n '/eth[0-9]*:/{s,:.*,,;p}'); do
/sbin/ifconfig $eth_int >/dev/null 2>&1 || continue /sbin/ifconfig $eth_int >/dev/null 2>&1 || continue
# found interface already configured # found interface already configured
[ -e $network_devices/ifconfig.$eth_int ] && continue [ -e $network_devices/ifcfg-$eth_int ] && continue
eth_ints[${#eth_ints[*]}]="$eth_int" eth_ints[${#eth_ints[*]}]="$eth_int"
echo "$eth_int" >> $postplugnew_file 2>/dev/null echo "$eth_int" >> $postplugnew_file 2>/dev/null
@ -341,16 +339,16 @@ fi
if [ $NETWORK_NEWDEVICE = "dialog" -a $int_newconf -gt 0 ]; then if [ $NETWORK_NEWDEVICE = "dialog" -a $int_newconf -gt 0 ]; then
for eth_int in ${eth_ints[*]}; do for eth_int in ${eth_ints[*]}; do
[ -r $network_devices/ifconfig.$eth_int ] || continue [ -r $network_devices/ifcfg-$eth_int ] || continue
unset BOOTPROTO unset BOOTPROTO
. $network_devices/ifconfig.$eth_int . $network_devices/ifcfg-$eth_int
[ "$BOOTPROTO" = "dhcp" ] && exit [ "$BOOTPROTO" = "dhcp" ] && exit
done done
for wlan_int in ${wlan_ints[*]}; do for wlan_int in ${wlan_ints[*]}; do
[ -r $network_devices/ifconfig.$wlan_int ] || continue [ -r $network_devices/ifcfg-$wlan_int ] || continue
unset BOOTPROTO unset BOOTPROTO
. $network_devices/ifconfig.$wlan_int . $network_devices/ifcfg-$wlan_int
[ "$BOOTPROTO" = "dhcp" ] && exit [ "$BOOTPROTO" = "dhcp" ] && exit
done done