#!/bin/sh

theFileCmd='set theFile to POSIX file ' 
startQuote='"' 
pathVar="$2" 
endQuote='"'
concatenatedString="$theFileCmd$startQuote$pathVar$endQuote"

sudo launchctl unload -w /Library/LaunchDaemons/com.pingman.pingplotter.mac_service.plist
sudo osascript -e "$concatenatedString" -e '
tell application "Finder"
    move theFile to trash
end tell'

mv "$1" "$2"

sudo launchctl load -w /Library/LaunchDaemons/com.pingman.pingplotter.mac_service.plist
