summarylogtreecommitdiffstats
path: root/mullvad-vpn.install
diff options
context:
space:
mode:
authortelans2019-10-19 09:41:15 +1300
committertelans2019-10-19 09:41:15 +1300
commit0ee8062eab5091ebc350beb88224acd3aca78db1 (patch)
tree4a639d53c56c451ac651a364070d05b549ed3917 /mullvad-vpn.install
parent264d3fdfaf836eb49aba7872bfa223394aa7d423 (diff)
downloadaur-0ee8062eab5091ebc350beb88224acd3aca78db1.tar.gz
remade PKGBUILD & files thanks to yochananmarqos
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 -------------------------------------------------------------
+}