summaryrefslogtreecommitdiffhomepage
path: root/dist-assets/pkg-scripts/postinstall
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2023-05-16 16:31:04 +0200
committerDavid Lönnhager <david.l@mullvad.net>2023-05-23 09:59:36 +0200
commit124ebaae1447da30aab1f5385f200f2de535de1b (patch)
treedaff040e04513a0dabb1f02a7a55094541ff4110 /dist-assets/pkg-scripts/postinstall
parent520d35245f59fe36463d0170645bde8832d8ccf5 (diff)
downloadmullvadvpn-124ebaae1447da30aab1f5385f200f2de535de1b.tar.xz
mullvadvpn-124ebaae1447da30aab1f5385f200f2de535de1b.zip
Run new CLI before stopping old daemon
Diffstat (limited to 'dist-assets/pkg-scripts/postinstall')
-rwxr-xr-xdist-assets/pkg-scripts/postinstall10
1 files changed, 10 insertions, 0 deletions
diff --git a/dist-assets/pkg-scripts/postinstall b/dist-assets/pkg-scripts/postinstall
index 716bc2b2e6..b91cd8a4e4 100755
--- a/dist-assets/pkg-scripts/postinstall
+++ b/dist-assets/pkg-scripts/postinstall
@@ -10,6 +10,16 @@ exec 2>&1 > $LOG_DIR/postinstall.log
echo "Running postinstall at $(date)"
INSTALL_DIR=$2
+
+# Run CLI to force macOS to check the certificate, and shut down the already running daemon, if one
+# exists.
+# This is a temporary workaround. After 2023.3, we switched from signing with Amagicom AB to
+# Mullvad VPN AB certificates. This could potentially be removed when older versions are no longer
+# supported.
+"$INSTALL_DIR/Mullvad VPN.app/Contents/Resources/mullvad" || true
+"$TMPDIR/mullvad-setup" prepare-restart || \
+ echo "Failed to send 'prepare-restart' command to old mullvad-daemon"
+
# NOTE: This path must be kept in sync with the path defined
# in mullvad-daemon/src/macos_launch_daemon.rs
DAEMON_PLIST_PATH="/Library/LaunchDaemons/net.mullvad.daemon.plist"