From 31569ac124a0363367a3590ba3b896535be0b292 Mon Sep 17 00:00:00 2001 From: Henri Date: Sat, 5 Dec 2020 09:24:20 +0100 Subject: [PATCH] Introduce on_change_command config attribute --- src/wgfrontend/config.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wgfrontend/config.py b/src/wgfrontend/config.py index 45d71e6..297c8c7 100644 --- a/src/wgfrontend/config.py +++ b/src/wgfrontend/config.py @@ -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"""