The --installpackage command is not working for me.
I am trying to reimage my non-dep macs so i've added the QuickAdd package so it re-enrolls.
This is the script im using. The quickad trigger adds the pkg to the /Users/Shared/ successfully but after the os is reinstalled it hasnt reenrolled.
#!/bin/sh
if [ -e "/Users/Shared/QuickAdd.pkg" ] && [ -e "/Applications/Install macOS Mojave.app" ]; then
/Applications/Install macOS Mojave.app/Contents/Resources/startosinstall --eraseinstall --agreetolicense --nointeraction --installpackage /Users/Shared/QuickAdd.pkg
echo "QuickAdd pkg and macOS Mojave app exists"
else
echo "QuickAdd & macOS Mojave app don't exist"
fi
if [ -e "/Users/Shared/QuickAdd.pkg" ]; then
echo "QuickAdd pkg exists"
else
jamf policy -trigger QuickAdd
echo "QuickAdd downloaded"
fi
if [ -e "/Applications/Install macOS Mojave.app" ]; then
echo "macOS Mojave app already exists"
else
jamf policy -trigger macOSInstaller
echo "macOS Mojave app downloaded"
fi
if [ -e "/Users/Shared/QuickAdd.pkg" ] && [ -e "/Applications/Install macOS Mojave.app" ]; then
/Applications/Install macOS Mojave.app/Contents/Resources/startosinstall --eraseinstall --agreetolicense --nointeraction --installpackage /Users/Shared/QuickAdd.pkg
fi