[PC-BSD Commits] r6247 - in pcbsd/trunk/pcbsd-netmanager/src: NetworkManager ethernetconfig wificonfig
svn at pcbsd.org
svn at pcbsd.org
Sat Feb 13 07:13:33 PST 2010
Author: kris
Date: 2010-02-13 07:13:33 -0800 (Sat, 13 Feb 2010)
New Revision: 6247
Modified:
pcbsd/trunk/pcbsd-netmanager/src/NetworkManager/networkman.cpp
pcbsd/trunk/pcbsd-netmanager/src/ethernetconfig/ethernetconfig.cpp
pcbsd/trunk/pcbsd-netmanager/src/wificonfig/wificonfigwidgetbase.cpp
Log:
Fixed a few bugs in the networking tools:
Destroy lagg0 interface before restarting networking, fixes bugs with netif not re-initing the device
Enable the configure button properly on the device listing
Run the net commands directly, prevent issues with sometimes networking not getting restarted properly
Modified: pcbsd/trunk/pcbsd-netmanager/src/NetworkManager/networkman.cpp
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/NetworkManager/networkman.cpp 2010-02-13 10:04:18 UTC (rev 6246)
+++ pcbsd/trunk/pcbsd-netmanager/src/NetworkManager/networkman.cpp 2010-02-13 15:13:33 UTC (rev 6247)
@@ -182,8 +182,10 @@
if ( DevsType[i] != "Wireless" ) comboPPPOEDev->addItem(Devs[i]);
}
- if(foundDev)
- i++;
+ if(foundDev) {
+ pushConfigure->setEnabled(TRUE);
+ i++;
+ }
}
}
@@ -994,7 +996,6 @@
// Disable functionality since we are not running as root
checkSysTray->setEnabled(TRUE);
checkSysTray->setHidden(FALSE);
- pushConfigure->setEnabled(FALSE);
lineDNS1->setEnabled(FALSE);
lineDNS2->setEnabled(FALSE);
lineHostname->setEnabled(FALSE);
Modified: pcbsd/trunk/pcbsd-netmanager/src/ethernetconfig/ethernetconfig.cpp
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/ethernetconfig/ethernetconfig.cpp 2010-02-13 10:04:18 UTC (rev 6246)
+++ pcbsd/trunk/pcbsd-netmanager/src/ethernetconfig/ethernetconfig.cpp 2010-02-13 15:13:33 UTC (rev 6247)
@@ -104,6 +104,7 @@
QString tmp, devices, tmp2;
// Enable the lagg0 interface
+ saveValue( "/etc/rc.conf", "ifconfig_" + dev, "ifconfig_" + dev + "=\"up\"", -1);
saveValue( "/etc/rc.conf", "cloned_interfaces", "cloned_interfaces=\"lagg0\"", -1);
tmp = getValue( "/etc/rc.conf", "ifconfig_lagg0=", 1 );
@@ -187,20 +188,10 @@
saveLaggLine(DeviceName, ifConfigLine);
- // Now restart the network for new settings to take effect
- QFile filerestart( "/tmp/.netrestart.sh" );
- if ( filerestart.open( QIODevice::WriteOnly ) ) {
- QTextStream streamrestart( &filerestart );
- streamrestart << "#!/bin/sh\n";
- streamrestart << "/etc/rc.d/netif restart " << DeviceName << "\n";
- //streamrestart << "/etc/rc.d/routing restart";
- filerestart.close();
- }
+ runCommand("ifconfig lagg0 destroy");
+ runCommand("/etc/rc.d/netif restart");
+ runCommand("/etc/rc.d/routing restart");
-
- //runCommand("chmod 755 /tmp/.netrestart.sh ; sh /tmp/.netrestart.sh");
- //runCommand("rm /tmp/.netrestart.sh");
-
// Done, now set the apply button to off
buttonApply->setEnabled(FALSE);
}
Modified: pcbsd/trunk/pcbsd-netmanager/src/wificonfig/wificonfigwidgetbase.cpp
===================================================================
--- pcbsd/trunk/pcbsd-netmanager/src/wificonfig/wificonfigwidgetbase.cpp 2010-02-13 10:04:18 UTC (rev 6246)
+++ pcbsd/trunk/pcbsd-netmanager/src/wificonfig/wificonfigwidgetbase.cpp 2010-02-13 15:13:33 UTC (rev 6247)
@@ -239,19 +239,9 @@
}
- // Now restart the network for new settings to take effect
- QFile filerestart( "/tmp/.netrestart.sh" );
- if ( filerestart.open( QIODevice::WriteOnly ) ) {
- QTextStream streamrestart( &filerestart );
- streamrestart << "#!/bin/sh\n";
- streamrestart << "/etc/rc.d/netif restart " << DeviceName << "\n";
- //streamrestart << "/etc/rc.d/routing restart";
- filerestart.close();
- }
-
-
- runCommand("chmod 755 /tmp/.netrestart.sh ; sh /tmp/.netrestart.sh");
- runCommand("rm /tmp/.netrestart.sh");
+ runCommand("ifconfig lagg0 destroy");
+ runCommand("/etc/rc.d/netif restart");
+ runCommand("/etc/rc.d/routing restart");
pushApply->setEnabled(FALSE);
}
More information about the Commits
mailing list