hello collective, I'm hoping someone can help me with the following. I'm trying to make our deployment process as easy as possible and am looking for a way to differentiate between faculty/staff machines and shared student machines. in my script i have the following, but it just hangs then exits. any help would be appreciated.
#!/bin/sh
computerType=$(osascript -e 'Tell application "System Events" to return choose from list {"Students", "Faculty", "Staff"}' 2>/dev/null)
if (( $? ));
then exit 1; fi # Abort, if user pressed Cancel.
if [[ "$computerType" == "Students" ]] ; then
#sets computer department to student in JamfPro
echo $computerType
sudo jamf recon -department $computerType
else
userName=$(osascript -e 'Tell application "System Events" to display dialog "Enter Faculty/Staff User Name" default answer ""' -e 'text returned of result' 2>/dev/null)
echo $username
sudo jamf recon -endUsername $userName
fi
exit 0