summarylogtreecommitdiffstats
path: root/mullvad-vpn.install
diff options
context:
space:
mode:
authoryochananmarqos2019-11-20 11:07:28 -0700
committeryochananmarqos2019-11-20 11:07:28 -0700
commitaf6d8666941571b40f501ea0c0345718f8e968ec (patch)
tree5fe5124fad07e9b50780ecd93ae1e88c4f6d43a6 /mullvad-vpn.install
downloadaur-af6d8666941571b40f501ea0c0345718f8e968ec.tar.gz
initial commit
Diffstat (limited to 'mullvad-vpn.install')
-rw-r--r--mullvad-vpn.install42
1 files changed, 42 insertions, 0 deletions
diff --git a/mullvad-vpn.install b/mullvad-vpn.install
new file mode 100644
index 000000000000..6fe7d441bf1f
--- /dev/null
+++ b/mullvad-vpn.install
@@ -0,0 +1,42 @@
+pre_install() {
+ if systemctl status mullvad-daemon &> /dev/null; then
+ echo 'Stopping & disabling Mullvad VPN daemon...'
+ systemctl disable --now mullvad-daemon
+ fi
+
+ rm -f /var/cache/mullvad-vpn/relays.json || true
+}
+
+post_install() {
+ echo 'Enabling Mullvad VPN daemon...'
+ systemctl enable --now mullvad-daemon
+}
+
+pre_upgrade() {
+ echo 'Stopping Mullvad VPN daemon...'
+ systemctl stop mullvad-daemon
+}
+
+post_upgrade() {
+ echo 'Restarting Mullvad VPN daemon...'
+ systemctl daemon-reload
+ systemctl start mullvad-daemon
+}
+
+pre_remove() {
+ # the user might've disabled or stopped the service themselves already
+ echo 'Making sure the Mullvad VPN daemon is stopped & disabled...'
+ systemctl stop mullvad-daemon || true
+ systemctl disable mullvad-daemon || true
+}
+
+post_remove() {
+ echo -------------------------------------------------------------
+ echo 'Optionally remove logs & cache:'
+ echo 'sudo rm -rf /var/log/mullvad-vpn/'
+ echo 'sudo rm -rf /var/cache/mullvad-vpn/'
+ echo ''
+ echo 'Optionally remove config:'
+ echo 'sudo rm -rf /etc/mullvad-vpn'
+ echo -------------------------------------------------------------
+}