Files
mullvad-vpn-alpine/mullvad-vpn-daemon/mullvad-vpn-daemon.pre-upgrade
2026-04-23 11:42:08 +02:00

19 lines
761 B
Bash

#!/usr/bin/env bash
set -eu
# Are we running systemd?
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
# Is `mullvad-daemon.service` running?
if systemctl status mullvad-daemon &> /dev/null; then
mullvad-setup prepare-restart || true
systemctl stop mullvad-daemon.service
systemctl disable mullvad-daemon.service
systemctl disable mullvad-early-boot-blocking.service || true
cp /var/log/mullvad-vpn/daemon.log /var/log/mullvad-vpn/old-install-daemon.log \
|| echo "Failed to copy old daemon log"
fi
fi
# Since we are upgrading mullvad-daemon, it will probably have current IP baked into itself.
rm -f /var/cache/mullvad-vpn/api-ip-address.txt