mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-26 23:19:33 +00:00
Client: Fix responce id
This commit is contained in:
@@ -51,6 +51,8 @@ class Client(object):
|
||||
self.client_id = socket.gethostname()
|
||||
elif config_id == '/ip':
|
||||
self.client_id = messaging.get_ip_address()
|
||||
else:
|
||||
self.client_id = config_id
|
||||
|
||||
logger.info("Config loaded")
|
||||
|
||||
|
||||
@@ -252,14 +252,15 @@ def _response_id(*args, **kwargs):
|
||||
old_id = client.active_client.client_id
|
||||
if new_id != old_id:
|
||||
client.active_client.config.set('PRIVATE', 'id', new_id, write=True)
|
||||
client.active_client.client_id = new_id
|
||||
if new_id != '/hostname':
|
||||
if client.active_client.system_restart_after_rename:
|
||||
if client.active_client.config.system_restart_after_rename:
|
||||
hostname = client.active_client.client_id
|
||||
configure_hostname(hostname)
|
||||
configure_hosts(hostname)
|
||||
configure_bashrc(hostname)
|
||||
configure_motd(hostname)
|
||||
execute_command("reboot")
|
||||
execute_command("systemctl stop clever-show & reboot")
|
||||
# execute_command("hostname {}".format(hostname))
|
||||
# restart_service("dhcpcd")
|
||||
# restart_service("avahi-daemon")
|
||||
|
||||
Reference in New Issue
Block a user