mirror of
https://github.com/PurpleComputing/mdmscripts.git
synced 2026-02-03 14:13:27 +00:00
Update show-dialog-depnotify.sh
This commit is contained in:
@@ -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 &
|
||||
|
||||
Reference in New Issue
Block a user