PDA

View Full Version : Wlan hacks for GUI



markkiteflyer
01-24-2011, 12:03 AM
Hi All,


For various reasons I run my vortexbox with only a wireless network card. Also, this configures as wlan1. As a result the GUI frequently breaks when I upgrade. This happened again today when I upgraded.


I can usually fix it, so I thought it might be helpful to someone else if I posted the fixes here.


Current version: vortexbox.i686 0:1.7-9.fc14


Files I need to change:


File /etc/rc.local


Add new line at the end

dhclient wlan1

File: /var/www/html/libs/vortexbox_defs.php


Change

$InterfacesToCheck = array("br0", "eth0", "eth1", "wlan0");

to

$InterfacesToCheck = array();
exec("ifconfig | grep -E '(eth|wlan|br)' | awk '{print $1}'",$InterfacesToCheck,$ret);
sort($InterfacesToCheck);



File: /var/www/html/templates/index.tpl


Change


eth0 MAC: {$MACADDRESS}


to


{$NIC} MAC: {$MACADDRESS}




File: /var/www/html/index.php


move this line

require '/var/www/html/libs/vortexbox_defs.php';

to above this line (which needs to be commented out):

#$macaddress=exec("ifconfig | grep -m 1 $nic | awk -F 'HWaddr ' '{ print $2 }'");

File: /var/www/html/config/index.php


Change

$ipaddress = exec("ifconfig eth0 | awk '/inet addr/ {split ($2,A,":"); print A[2]}'");

to

require '/var/www/html/libs/vortexbox_defs.php';
#$ipaddress = exec("ifconfig eth0 | awk '/inet addr/ {split ($2,A,":"); print A[2]}'");



So a total of 4 GUI files edited, all with small edits and the change to rc.local to get wlan1 connected.


I can only test with my system, but I hope it helps.


mkf

andrew
01-24-2011, 05:48 AM
Nice I added your changes to the release code.


Don't make changes to rc.local. They will get overwritten. If you want to use a custom network do it this way.


http://info.vortexbox.org/tiki.....tartOnBoot (http://info.vortexbox.org/tiki-index.php?page=StartOnBoot)

markkiteflyer
01-26-2011, 11:16 PM
Hi Andrew,


Thanks for the tip on autostarting wlan1.


I found a couple more instances where "eth0" is hardcoded in /var/www/html/libs/vortexbox_defs.php


Initial variable definitions for $file and $tempfile need to be moved after the discovery of $nic and changed to:



$file = "/etc/sysconfig/network-scripts/ifcfg-$nic";
$tempfile = "$file.new";



I can't be sure what all the rammifications might be, but it should create a cfg for each nic in the unlikely event it changes.


mkf