shadowsocks: Completely uninstall app

Test: Functional tests passed

Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
nbenedek authored and Sunil Mohan Adapa committed 2023-04-13 08:14:47 +05:30
1 parent 6ab0be6f9a
commit 95e370a1bf
2 files changed
+12

No files matched your search

+5
View File
@@ -84,3 +84,8 @@ class ShadowsocksApp(app_module.App):
super().setup(old_version)
privileged.setup()
self.enable()
def uninstall(self):
"""De-configure and uninstall the app."""
super().uninstall()
privileged.uninstall()
+7
View File
@@ -95,3 +95,10 @@ def merge_config(config: dict[str, Union[int, str]]):
from . import ShadowsocksApp
if action_utils.service_is_enabled(ShadowsocksApp.DAEMON):
action_utils.service_restart(ShadowsocksApp.DAEMON)
@privileged
def uninstall():
"""Remove configuration files."""
for path in SHADOWSOCKS_CONFIG_SYMLINK, SHADOWSOCKS_CONFIG_ACTUAL:
pathlib.Path(path).unlink(missing_ok=True)