summaryrefslogtreecommitdiffhomepage
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/install_script.sh2
-rw-r--r--linux/uninstall_script.sh37
2 files changed, 34 insertions, 5 deletions
diff --git a/linux/install_script.sh b/linux/install_script.sh
index 37d7e312fc..ea03f94c91 100644
--- a/linux/install_script.sh
+++ b/linux/install_script.sh
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
-set -eux
+set -eu
systemctl enable mullvad-daemon.service
systemctl start mullvad-daemon.service
diff --git a/linux/uninstall_script.sh b/linux/uninstall_script.sh
index b349962968..d4565bcae2 100644
--- a/linux/uninstall_script.sh
+++ b/linux/uninstall_script.sh
@@ -1,5 +1,34 @@
#!/usr/bin/env bash
-set -ux
-systemctl stop mullvad-daemon.service
-systemctl disable mullvad-daemon.service
-exit 0
+set -eu
+function remove_systemd_unit {
+ systemctl stop mullvad-daemon.service
+ systemctl disable mullvad-daemon.service
+}
+
+function remove_logs_and_cache {
+ rm -rf /var/log/mullvad-daemon/
+ rm -rf /var/cache/mullvad-daemon/
+}
+
+function remove_config {
+ rm -rf /etc/mullvad-daemon
+}
+
+# checking what kind of an action is taking place
+case $@ in
+ # apt purge passes "purge"
+ "purge")
+ remove_logs_and_cache
+ remove_config
+ ;;
+ # apt remove passes "remove"
+ "remove")
+ remove_systemd_unit
+ ;;
+ # yum remove passes a 0
+ "0")
+ remove_logs_and_cache
+ remove_systemd_unit
+ remove_config
+ ;;
+esac