#!/bin/sh
sudo chown -R root:wheel /System/Library/Extensions/SXUPTPLegacy.kext
sudo chown -R root:wheel /System/Library/Extensions/SXUPTP.kext
sudo chmod -R 775 /Applications/SharePort\ Utility.app
sudo chmod -R 775 /Library/Preferences/D-Link
sudo chmod -R 775 /Library/Preferences/D-Link/SharePort\ Utility
sudo chmod -R 775 /Library/Preferences/D-Link/SharePort\ Utility/Help
sudo rm -rf /System/Library/Extensions.kextcache
sudo rm -rf /System/Library/Extensions.mkext
sudo touch /System/Library/Extensions
osascript << EOF
set a to path to applications folder as string
set b to a & "SharePort Utility.app"
set p to POSIX path of b
tell application "System Events"
make login item at end with properties {path:p, hidden:false}
end tell
EOF