diff --git a/plinth/modules/openvpn/__init__.py b/plinth/modules/openvpn/__init__.py index 832723573..40991a7b2 100644 --- a/plinth/modules/openvpn/__init__.py +++ b/plinth/modules/openvpn/__init__.py @@ -91,3 +91,8 @@ class OpenVPNApp(app_module.App): super().setup(old_version) privileged.setup() self.enable() + + def uninstall(self): + """De-configure and uninstall the app.""" + super().uninstall() + privileged.uninstall() diff --git a/plinth/modules/openvpn/privileged.py b/plinth/modules/openvpn/privileged.py index e33c7c541..aaf0432d3 100644 --- a/plinth/modules/openvpn/privileged.py +++ b/plinth/modules/openvpn/privileged.py @@ -2,6 +2,7 @@ """Configure OpenVPN server.""" import os +import shutil import subprocess import augeas @@ -222,3 +223,9 @@ def load_augeas(): aug.set('/augeas/load/Simplevars/incl[last() + 1]', ATTR_FILE) aug.load() return aug + + +@privileged +def uninstall(): + """Remove configuration directory for OpenVPN.""" + shutil.rmtree('/etc/openvpn', ignore_errors=True)