blob: 375f7eab5f0ba8e0f39564715ec1820ae2aa305c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/usr/bin/env bash
set -eu
is_number_re='^[0-9]+$'
# Check if we're running during an upgrade step on Fedora
# https://fedoraproject.org/wiki/Packaging:Scriptlets#Syntax
if [[ "$1" =~ $is_number_re ]] && [ $1 -gt 0 ]; then
echo not running
exit 0;
fi
if [[ "$1" == "upgrade" ]]; then
echo not running
exit 0;
fi
mullvad account clear-history || echo "Failed to remove leftover WireGuard keys"
if which systemctl &> /dev/null; then
# the user might've disabled or stopped the service themselves already
systemctl stop mullvad-daemon.service || true
systemctl disable mullvad-daemon.service || true
elif /sbin/init --version | grep upstart &> /dev/null; then
stop mullvad-daemon
rm -f /etc/init/mullvad-daemon.conf
fi
|