From 5c7e37256f1a112f238d7d68ee5336ef78360ab7 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Wed, 10 Dec 2008 14:40:56 -0600 Subject: Add wireless extensions for eth0 and eth1 --- abs/core-testing/LinHES-config/PKGBUILD | 2 +- abs/core-testing/LinHES-config/networkconfig.sh | 34 +++++++++++--------- abs/mv-core/MythVantage-config/networkconfig.sh | 41 ++++++++++++------------- 3 files changed, 40 insertions(+), 37 deletions(-) diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD index d35dfbb..d9f7f20 100755 --- a/abs/core-testing/LinHES-config/PKGBUILD +++ b/abs/core-testing/LinHES-config/PKGBUILD @@ -1,6 +1,6 @@ pkgname=LinHES-config pkgver=1.0 -pkgrel=89 +pkgrel=93 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev ) pkgdesc="Install and configure your system" depends=(bc libstatgrab mysql-python expect curl dnsutils parted sg3_utils nmbscan ) diff --git a/abs/core-testing/LinHES-config/networkconfig.sh b/abs/core-testing/LinHES-config/networkconfig.sh index 61a7405..9ad2d4e 100644 --- a/abs/core-testing/LinHES-config/networkconfig.sh +++ b/abs/core-testing/LinHES-config/networkconfig.sh @@ -6,7 +6,7 @@ ETCNETDIR=$BASE/etc/net/ifaces -function kill_dhcp () +function kill_dhcp () { for i in ${BASE}/etc/dhcpc/dhcpcd-*.pid do @@ -19,12 +19,12 @@ do if [ x$1 = xflush ] then for ifdev in eth0 wlan0 eth1 wlan1 - do + do echo ${i} |grep $ifdev status=$? if [ $status = 1 ] then - ip address flush $ifdev + ip address flush $ifdev fi done fi @@ -65,7 +65,7 @@ function setup_interfaces() { TEMPNET=Hostnetmask$1 eval netmask=\$${TEMPNET} netmask=`echo "$netmask" | cut -d " " -f1` - + TEMPNET=HostActive$1 eval isactive=\$${TEMPNET} @@ -78,24 +78,28 @@ function setup_interfaces() { TEMPNET=HostGW$1 eval GW=\$${TEMPNET} + TEMPNET=HOST_iswireless$1 + eval wireless=\$${TEMPNET} + + - if [ $1 = wlan0 -o $1 = wlan1 ] + if [ x$wireless = x1 ] then IS_WIRELESS=TRUE TEMPNET=HostESSID$1 eval ESSID=\$${TEMPNET} - + TEMPNET="HostKey"$1 eval KEY=\$${TEMPNET} - + TEMPNET=HostUseEncryption$1 eval ENCRYPT=\$${TEMPNET} fi - + echo "Setup $1 in progress, wireless: $IS_WIRELESS" - + if [ ! -d $ETCNETDIR/$1 ] then mkdir -p $ETCNETDIR/$1 @@ -110,7 +114,7 @@ function setup_interfaces() { then echo "setting $1 to inactive" sed -i -e 's/^ONBOOT=.*$/ONBOOT=no/g' $ETCNETDIR/$1/options - + else echo "setting $1 to active" sed -i -e 's/^ONBOOT=.*$/ONBOOT=yes/g' $ETCNETDIR/$1/options @@ -126,7 +130,7 @@ function setup_interfaces() { then echo "key $KEY" >> $ETCNETDIR/$1/iwconfig fi - + else echo "disabling wireless" sed -i -e 's/^CONFIG_WIRLESS=.*$/CONFIG_WIRLESS=no/g' $ETCNETDIR/$1/options @@ -139,7 +143,7 @@ function setup_interfaces() { then echo using dhcp sed -i -e 's/^BOOTPROTO=.*$/BOOTPROTO=dhcp/g' $ETCNETDIR/$1/options - + else echo "using static ip" sed -i -e 's/^BOOTPROTO=.*$/BOOTPROTO=static/g' $ETCNETDIR/$1/options @@ -160,7 +164,7 @@ if [ x$MYTHDHCP = x1 ] echo "nameserver 127.0.0.1" >> ${BASE}/etc/resolv.conf fi -for i in eth0 eth1 wlan0 wlan1 +for i in eth0 eth1 wlan0 wlan1 do CURRENTIF="HostActive"$i eval IFSTATE=\$${CURRENTIF} @@ -219,11 +223,11 @@ function setup_MYTH_vars { TEMPMYTH="Hostip"$default_interface #echo $TEMPMYTH eval MYTHIP=\$${TEMPMYTH} - + TEMPMYTH="HostUSEDHCP"$default_interface eval MYTHDHCP=\$${TEMPMYTH} - + } diff --git a/abs/mv-core/MythVantage-config/networkconfig.sh b/abs/mv-core/MythVantage-config/networkconfig.sh index 999ccb0..9ad2d4e 100644 --- a/abs/mv-core/MythVantage-config/networkconfig.sh +++ b/abs/mv-core/MythVantage-config/networkconfig.sh @@ -78,9 +78,13 @@ function setup_interfaces() { TEMPNET=HostGW$1 eval GW=\$${TEMPNET} + TEMPNET=HOST_iswireless$1 + eval wireless=\$${TEMPNET} - if [ $1 = wlan0 -o $1 = wlan1 ] + + + if [ x$wireless = x1 ] then IS_WIRELESS=TRUE TEMPNET=HostESSID$1 @@ -193,30 +197,25 @@ kill_dhcp } function vnc_check() { - if [ x$RESTART_NETWORK = xfalse ] + CMDLINE=$(cat /proc/cmdline) + echo $CMDLINE |grep -q vnc + USEVNC=$? + echo $CMDLINE |grep -q nfsroot + NETBOOT=$? + echo $USEVNC + if [ ! x$USEVNC = x0 ] then - echo "netboot install or image creating, will not restart network" - USEVNC=0 - else - CMDLINE=$(cat /proc/cmdline) - echo $CMDLINE |grep -q vnc - USEVNC=$? - echo $CMDLINE |grep -q nfsroot - NETBOOT=$? - echo $USEVNC - if [ ! x$USEVNC = x0 ] + echo "not using vnc" + if [ ! x$NETBOOT = x0 ] then - echo "not using vnc" - if [ ! x$NETBOOT = x0 ] - then - echo "not using netboot" - else - echo "using netboot" - USEVNC=0 - fi + echo "not using netboot" else - echo " using vnc" + echo "using netboot" + USEVNC=0 fi + + else + echo " using vnc" fi } -- cgit v0.12