summaryrefslogtreecommitdiffhomepage
path: root/dist-assets/pkg-scripts
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2021-01-19 12:50:30 +0100
committerDavid Lönnhager <david.l@mullvad.net>2021-01-19 19:13:26 +0100
commitbffd7b28db6a901d5ff2e9b97d95f94d8dd46abb (patch)
tree91461be8f2cbc7c3a83cbb978b0f011a8d744666 /dist-assets/pkg-scripts
parent6c377956d6134aa1492f0eb9b6788ea545081cbd (diff)
downloadmullvadvpn-bffd7b28db6a901d5ff2e9b97d95f94d8dd46abb.tar.xz
mullvadvpn-bffd7b28db6a901d5ff2e9b97d95f94d8dd46abb.zip
Save target state cache before migrating cache
Diffstat (limited to 'dist-assets/pkg-scripts')
-rwxr-xr-xdist-assets/pkg-scripts/preinstall12
1 files changed, 6 insertions, 6 deletions
diff --git a/dist-assets/pkg-scripts/preinstall b/dist-assets/pkg-scripts/preinstall
index 4259f3d523..e721e2ae24 100755
--- a/dist-assets/pkg-scripts/preinstall
+++ b/dist-assets/pkg-scripts/preinstall
@@ -11,6 +11,12 @@ exec 2>&1 > $LOG_DIR/preinstall.log
echo "Running preinstall at $(date)"
+# Notify the running daemon that we are going to kill it and replace it with a newer version.
+# This will make the daemon save it's state to a file and then lock the firewall to prevent
+# leaks during the upgrade.
+"$INSTALL_DIR/Mullvad VPN.app/Contents/Resources/mullvad-setup" prepare-restart || \
+ echo "Failed to send 'prepare-restart' command to old mullvad-daemon"
+
# Migrate cache files from <=2020.8-beta2 paths
OLD_CACHE_DIR="/var/root/Library/Caches/mullvad-vpn"
NEW_CACHE_DIR="/Library/Caches/mullvad-vpn"
@@ -26,9 +32,3 @@ fi
# There is a risk that they're incompatible with the format this version wants
rm "$NEW_CACHE_DIR/relays.json" || true
rm "$NEW_CACHE_DIR/api-ip-address.txt" || true
-
-# Notify the running daemon that we are going to kill it and replace it with a newer version.
-# This will make the daemon save it's state to a file and then lock the firewall to prevent
-# leaks during the upgrade.
-"$INSTALL_DIR/Mullvad VPN.app/Contents/Resources/mullvad-setup" prepare-restart || \
- echo "Failed to send 'prepare-restart' command to old mullvad-daemon"