Introduce on_change_command config attribute

This commit is contained in:
Henri 2020-12-05 09:24:20 +01:00
parent 7aca808caf
commit 31569ac124

View File

@ -50,6 +50,10 @@ class Configuration():
# The WireGuard config file to read and write # The WireGuard config file to read and write
wg_configfile = {wg_configfile} wg_configfile = {wg_configfile}
# 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"
# The system user to be used for the frontend # The system user to be used for the frontend
user = {user} user = {user}
@ -102,6 +106,11 @@ class Configuration():
"""The directory for the generated config files""" """The directory for the generated config files"""
return '/var/lib/wgfrontend' return '/var/lib/wgfrontend'
@property
def on_change_command(self):
"""The command to be executed on config changes"""
return self.config.get('on_change_command')
@property @property
def user(self): def user(self):
"""The configured name for the wgfrontend system user""" """The configured name for the wgfrontend system user"""