#!/bin/sh

for sessiontype in Aqua LoginWindow; do
	ps aux | grep loginwindow.app | grep -v grep | awk -v s=$sessiontype '{system("sudo launchctl bsexec "$2" sudo -u "$1" launchctl load -S "s" /Library/LaunchAgents/com.parallels.DesktopControlAgent.plist")}' 2>&1 >/dev/null
done

# Copy receipts to Parallels Receipts directory
SWD=`cd "${0%/*}"; pwd`
. "${SWD}"/receipt.sh

true
