mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
Change first_boot module to show and update current hostname,
instead of showing the box_name value and failing to set anything when the user specify a host name value.
This commit is contained in:
1 parent
ec9a457e3e
commit
71873b6702
2 files changed
+15
-20
No files matched your search
@@ -40,6 +40,9 @@ def valid_hostname(name):
|
||||
|
||||
return message
|
||||
|
||||
def get_hostname():
|
||||
return gethostname()
|
||||
|
||||
def set_hostname(hostname):
|
||||
"Sets machine hostname to hostname"
|
||||
cfg.log.info("Writing '%s' to /etc/hostname with exmachina" % hostname)
|
||||
@@ -53,7 +56,7 @@ def set_hostname(hostname):
|
||||
if platform.linux_distribution()[0]=="Ubuntu" :
|
||||
cfg.exmachina.service.start("hostname")
|
||||
else:
|
||||
cfg.exmachina.initd.restart("hostname.sh") # is hostname.sh debian-only?
|
||||
cfg.exmachina.initd.start("hostname.sh") # is hostname.sh debian-only?
|
||||
except OSError, e:
|
||||
raise cherrypy.HTTPError(500, "Hostname restart failed: %s" % e)
|
||||
|
||||
|
||||
Reference in new issue
Block a user