Update show-dialog-depnotify.sh

This commit is contained in:
Michael
2023-04-23 12:34:01 +01:00
committed by GitHub
parent 18a7861ee8
commit 788daac34c

View File

@@ -3,6 +3,20 @@
# SERVICE SCRIPT CALLED BY OTHER SCRIPTS
currentLogUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ { print $3 }')
uid=$(id -u "$currentLogUser")
runAsLogUser() {
if [ "$currentLogUser" != "loginwindow" ]; then
launchctl asuser "$uid" sudo -u "$currentLogUser" "$@"
else
echo "No user logged in."
# uncomment the exit command
# to make the function exit with an error when no user is logged in
# exit 1
fi
}
# UPDATE PURPLE HELPERS
curl -s -L https://prpl.it/helperscript | bash
@@ -17,4 +31,5 @@ echo "$MDMAPPNAME" >> /Library/Caches/com.purplecomputing.mdm/Apps/.appinstallna
curl -s -L https://prpl.it/brandDEPinstall | bash
# START DEPNOTIFY
sudo -u $(stat -f "%Su" /dev/console) /Library/Application\ Support/Purple/launch-dep.sh &
#sudo -u $(stat -f "%Su" /dev/console) /Library/Application\ Support/Purple/launch-dep.sh &
runAsLogUser /Library/Application\ Support/Purple/launch-dep.sh &