1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-28 17:32:36 +01:00

add support for copying dhclient.conf.template from a default file if it isn't found

This commit is contained in:
Adam Blackburn
2009-12-23 16:48:39 -10:00
parent a327a824f7
commit fa76ba5a7a
4 changed files with 28 additions and 4 deletions

View File

@@ -34,6 +34,7 @@ class WirelessDaemon() -- DBus interface to managed the wireless network.
#
import os
import shutil
import sys
import time
import getopt
@@ -66,6 +67,7 @@ misc.RenameProcess("wicd")
wireless_conf = wpath.etc + "wireless-settings.conf"
wired_conf = wpath.etc + "wired-settings.conf"
dhclient_conf = wpath.etc + "dhclient.conf.template"
class WicdDaemon(dbus.service.Object):
""" The main wicd daemon class.
@@ -936,6 +938,9 @@ class WicdDaemon(dbus.service.Object):
open(wired_conf, "w").close()
b_wired.CreateWiredNetworkProfile("wired-default", default=True)
if not os.path.isfile(dhclient_conf):
print "dhclient.conf.template not found, copying..."
shutil.copy(dhclient_conf + ".default", dhclient_conf)
# Hide the files, so the keys aren't exposed.
print "chmoding configuration files 0600..."
os.chmod(app_conf.get_config(), 0600)