13 lines
600 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
# Stop only the product's registered services before replacing their binaries.
launchctl bootout system/com.drobotics.drosync.daemon 2>/dev/null || true
console_uid=$(stat -f '%u' /dev/console)
if [[ "$console_uid" -ge 500 ]]; then
launchctl bootout "gui/$console_uid/com.drobotics.drosync.agent" 2>/dev/null || true
fi
# Old packages used this product-owned symlink into the retired App bundle.
if [[ -L /usr/local/bin/drosync ]] && [[ "$(readlink /usr/local/bin/drosync)" == "/Applications/drosync.app/Contents/MacOS/drosync" ]]; then
rm /usr/local/bin/drosync
fi