#!/bin/sh

#

# if [ -f /usr/local/sbin/FileWave.app/Contents/MacOS/1100 ]; then
#   rm /usr/local/sbin/FileWave.app/Contents/MacOS/1100

  killall fwcld
  killall fwGUI
  /usr/local/bin/fwcontrol client restart
# else
#   # Rely on fwcontrol script to stop and start the fwcld and fwGUI
#   /usr/local/bin/fwcontrol fwgui restart
#   /usr/local/bin/fwcontrol client restart
# fi

# Register FileWave Kiosk
UIDS=$(dscl . -list /Users UniqueID | grep -v '^_' | grep -Ev 'daemon|nobody|root' | awk '{ print $2 }')
for uid in $UIDS; do
    /bin/launchctl bootout gui/$uid /Library/LaunchAgents/com.filewave.kiosk2.plist
    /bin/launchctl bootstrap gui/$uid /Library/LaunchAgents/com.filewave.kiosk2.plist
done

# Delete self
rm $0

