mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
Fix to allow hostname to be updated on Ubuntu. This needed a change to exmachina which I've created a pull request for. I've updated Make to point to my fork of exmachina until this has been merged, when it can be reverted.
This commit is contained in:
1 parent
8e16374136
commit
b54a4906e6
2 files changed
+6
-2
No files matched your search
@@ -10,6 +10,7 @@ import cfg
|
||||
from forms import Form
|
||||
from model import User
|
||||
from util import *
|
||||
import platform
|
||||
|
||||
class Config(PagePlugin):
|
||||
def __init__(self, *args, **kwargs):
|
||||
@@ -49,7 +50,10 @@ def set_hostname(hostname):
|
||||
# don't persist/cache change unless it was saved successfuly
|
||||
sys_store = filedict_con(cfg.store_file, 'sys')
|
||||
sys_store['hostname'] = hostname
|
||||
cfg.exmachina.initd.restart("hostname.sh") # is hostname.sh debian-only?
|
||||
if platform.linux_distribution()[0]=="Ubuntu" :
|
||||
cfg.exmachina.service.start("hostname")
|
||||
else:
|
||||
cfg.exmachina.initd.restart("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