git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix more very stupid bugs... someone must have had too much drinks while writing...
[enigma2.git]
/
lib
/
python
/
Components
/
Network.py
diff --git
a/lib/python/Components/Network.py
b/lib/python/Components/Network.py
index 99afb75db93c7dd946fc95353fe59006c24bd595..365e15f08ae24c203017f6d53da4bb384bbfc78e 100644
(file)
--- a/
lib/python/Components/Network.py
+++ b/
lib/python/Components/Network.py
@@
-12,7
+12,7
@@
class Network:
# fixme using interfaces.tmp instead of interfaces for now
fp = file('/etc/network/interfaces', 'w')
fp.write("auto eth0\n")
# fixme using interfaces.tmp instead of interfaces for now
fp = file('/etc/network/interfaces', 'w')
fp.write("auto eth0\n")
- if (config.network.dhcp.value ==
_("yes")
):
+ if (config.network.dhcp.value ==
1
):
fp.write("iface eth0 inet dhcp\n")
else:
fp.write("iface eth0 inet static\n")
fp.write("iface eth0 inet dhcp\n")
else:
fp.write("iface eth0 inet static\n")
@@
-21,6
+21,12
@@
class Network:
fp.write(" gateway %d.%d.%d.%d\n" % tuple(config.network.gateway.value))
fp.close()
fp.write(" gateway %d.%d.%d.%d\n" % tuple(config.network.gateway.value))
fp.close()
+ if config.network.dhcp.value == 0:
+ fp = file('/etc/resolv.conf', 'w')
+ fp.write("nameserver %d.%d.%d.%d\n" % tuple(config.network.dns.value))
+ fp.close()
+
+
def loadNetworkConfig(self):
try:
# parse the interfaces-file
def loadNetworkConfig(self):
try:
# parse the interfaces-file
@@
-48,7
+54,7
@@
class Network:
ifaces[currif]["gateway"] = map(int, split[1].split('.'))
# parse the resolv.conf-file
ifaces[currif]["gateway"] = map(int, split[1].split('.'))
# parse the resolv.conf-file
- fp = file('/etc/
network/interfaces
', 'r')
+ fp = file('/etc/
resolv.conf
', 'r')
resolv = fp.readlines()
fp.close()
except:
resolv = fp.readlines()
fp.close()
except: