mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
Merge pull request #7 from tomgalloway/master
Fix to allow hostname to be updated on Ubuntu.
This commit is contained in:
commit
5ceeded54e
2
Makefile
2
Makefile
@ -21,7 +21,7 @@ predepend:
|
|||||||
touch predepend
|
touch predepend
|
||||||
|
|
||||||
$(BUILD_DIR)/exmachina: build
|
$(BUILD_DIR)/exmachina: build
|
||||||
git clone git://github.com/bnewbold/exmachina $(BUILD_DIR)/exmachina
|
git clone git://github.com/tomgalloway/exmachina $(BUILD_DIR)/exmachina
|
||||||
|
|
||||||
$(BUILD_DIR)/bjsonrpc: build
|
$(BUILD_DIR)/bjsonrpc: build
|
||||||
git clone git://github.com/deavid/bjsonrpc.git $(BUILD_DIR)/bjsonrpc
|
git clone git://github.com/deavid/bjsonrpc.git $(BUILD_DIR)/bjsonrpc
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import cfg
|
|||||||
from forms import Form
|
from forms import Form
|
||||||
from model import User
|
from model import User
|
||||||
from util import *
|
from util import *
|
||||||
|
import platform
|
||||||
|
|
||||||
class Config(PagePlugin):
|
class Config(PagePlugin):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@ -49,7 +50,10 @@ def set_hostname(hostname):
|
|||||||
# don't persist/cache change unless it was saved successfuly
|
# don't persist/cache change unless it was saved successfuly
|
||||||
sys_store = filedict_con(cfg.store_file, 'sys')
|
sys_store = filedict_con(cfg.store_file, 'sys')
|
||||||
sys_store['hostname'] = hostname
|
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:
|
except OSError, e:
|
||||||
raise cherrypy.HTTPError(500, "Hostname restart failed: %s" % e)
|
raise cherrypy.HTTPError(500, "Hostname restart failed: %s" % e)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user