Use $appPath variable and quote whoami output

This commit is contained in:
Elliot Jordan
2024-07-05 14:16:24 -07:00
parent f68ce643da
commit dc233bb393

View File

@@ -24,7 +24,7 @@ bundleID="com.jamf.setupmanager"
appPath="/Applications/Utilities/${appName}.app"
if [ $(whoami) != "root" ]; then
if [ "$(whoami)" != "root" ]; then
echo "needs to run as root!"
exit 1
fi
@@ -35,7 +35,7 @@ if launchctl list | grep -q "$bundleID" ; then
fi
echo "removing files"
rm -rfv /Applications/Utilities/"$appName".app
rm -rfv "$appPath"
rm -v /Library/LaunchDaemons/"$bundleID".plist
pkgutil --forget "$bundleID"