Hey guys,
i was trying to upload "System information" policy to self service using the following script.
the problem is that at the end of it, while pressing on "button 2" - "Screenshot" the information box is being closed and the screenshot is being taken, this means the screenshot miss the important part, which is the information box.
how can i delay the process in few seconds so the "System information" box won't disappear before screenshot is being taken
thanks in advance,
Dean Vaturi
!/bin/sh
JHELPER="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
USERNAME=$(ls -l /dev/console | awk '{print $3}')
MACNAME=$(scutil --get ComputerName)
PORT=$(/usr/sbin/netstat -rn -f inet | awk '/default/{print $NF; exit}')
IPADDRESS=$(ipconfig getifaddr $PORT)
MACADDRESS=$(networksetup -getmacaddress $PORT | awk '{print $3}')
MESSAGE="You are logged in as: $USERNAME
Computer name: $MACNAME
IP Address: $IPADDRESS
MAC Address: $MACADDRESS"
THEMESSAGE=$("$JHELPER" -windowType utility -title "Palo Alto Networks System Information" -description "$MESSAGE" -button1 "OK" -button2 "Screenshot" -defaultButton 1 -icon "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericNetworkIcon.icns" -iconSize 64)
if [ "$THEMESSAGE" == "0" ]; then
exit 0
elif [ "$THEMESSAGE" == "2" ]; then
DATE=$(date +"%Y-%m-%d at%l.%M.%S %p")
screencapture -t png "/Users/$USERNAME/Desktop/Screen Shot ${DATE}.png"
chown ${USERNAME}:staff "/Users/$USERNAME/Desktop/Screen Shot ${DATE}.png"
exit 0
fi