-from Components.config import config, ConfigYesNo, ConfigIP, NoSave, ConfigSubsection, ConfigMAC
-
import os
import re
from socket import *
return data
def writeNetworkConfig(self):
- fp = file('/etc/network/interfaces.tmp', 'w')
+ fp = file('/etc/network/interfaces', 'w')
fp.write("# automatically generated by enigma 2\n# do NOT change manually!\n\n")
fp.write("auto lo\n")
fp.write("iface lo inet loopback\n\n")
fp.write(" netmask %d.%d.%d.%d\n" % tuple(iface['netmask']))
if iface.has_key('gateway'):
fp.write(" gateway %d.%d.%d.%d\n" % tuple(iface['gateway']))
+
+ if iface.has_key("configStrings"):
+ fp.write("\n" + iface["configStrings"] + "\n")
fp.write("\n")
fp.close()
self.writeNameserverConfig()
interfaces = []
# parse the interfaces-file
try:
- fp = file('/etc/network/interfaces.tmp', 'r')
+ fp = file('/etc/network/interfaces', 'r')
interfaces = fp.readlines()
fp.close()
except:
def deactivateNetworkConfig(self):
for iface in self.ifaces.keys():
- os.system("ip addr flush" + iface)
+ os.system("ip addr flush " + iface)
os.system("/etc/init.d/networking stop")
os.system("killall -9 udhcpc")
os.system("rm /var/run/udhcpc*")
return None
def setAdapterAttribute(self, iface, attribute, value):
+ print "setting for adapter", iface, "attribute", attribute, " to value", value
if self.ifaces.has_key(iface):
self.ifaces[iface][attribute] = value