mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
deluge: Completely uninstall app
Remove deluge default file, config directory, and systemd service file Test: 1. In a Vagrant box manually install the app 2. Modify the default download path and change the default password 3. Uninstall the app 4. Confirm that the download path and password are reset to default 5. Also test enabling and disabling the app after reinstallation Signed-off-by: nbenedek <contact@nbenedek.me> [sunil: Update docstings and 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:
parent
db2d42c5ac
commit
615c47e49f
@ -100,3 +100,8 @@ class DelugeApp(app_module.App):
|
||||
add_user_to_share_group(SYSTEM_USER)
|
||||
privileged.setup()
|
||||
self.enable()
|
||||
|
||||
def uninstall(self):
|
||||
"""De-configure and uninstall the app."""
|
||||
super().uninstall()
|
||||
privileged.uninstall()
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
"""Configuration helper for BitTorrent web client."""
|
||||
|
||||
import pathlib
|
||||
import shutil
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
@ -154,3 +155,12 @@ def _wait_for_configuration(service, file_name):
|
||||
|
||||
if not is_running:
|
||||
action_utils.service_stop(service)
|
||||
|
||||
|
||||
@privileged
|
||||
def uninstall():
|
||||
"""Remove configuration and service files."""
|
||||
for item in DELUGED_DEFAULT_FILE, DELUGE_WEB_SYSTEMD_SERVICE_PATH:
|
||||
pathlib.Path(item).unlink(missing_ok=True)
|
||||
|
||||
shutil.rmtree(DELUGE_CONF_DIR, ignore_errors=True)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user