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

@ -49,6 +49,10 @@ class Configuration():
[general]
# The WireGuard config file to read and write
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
user = {user}
@ -102,6 +106,11 @@ class Configuration():
"""The directory for the generated config files"""
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
def user(self):
"""The configured name for the wgfrontend system user"""