Change indentation and strip quotes in more controlled manner

This commit is contained in:
Henri 2021-02-26 22:13:32 +01:00
parent c8dc8d1ffb
commit 94b2053585

View File

@ -57,7 +57,7 @@ class Configuration():
# The command to be executed when the WireGuard config has changed
# on_change_command =
# Example: on_change_command = "sudo /etc/init.d/wgfrontend_interface restart"
on_change_command = "sudo --non-interactive wg-quick down {wg_configfile}; sudo --non-interactive wg-quick up {wg_configfile}"
# The interface the web server shall bind to
# socket_host = 0.0.0.0
@ -130,7 +130,8 @@ class Configuration():
"""The command to be executed on config changes"""
cmd = self.config.get('on_change_command')
if cmd is not None:
cmd = cmd.strip('"\'')
if cmd[0] in ['"', '\'']:
cmd = cmd[1:-1]
return cmd
@property