#!/bin/bash

set +e

# Identify the user installing the package
USER=$(stat -f%Su /dev/console)

if [ -f "/Library/LaunchAgents/com.duplicati.app.launchagent.plist" ]; then
    /bin/launchctl bootout gui/$(id -u "$USER")/com.duplicati.app.launchagent
    /bin/launchctl unload "/Library/LaunchAgents/com.duplicati.app.launchagent.plist"
fi

