Is there anyway to have a multi-line message? I am trying to have a user click on a button in self service and display things like computer name / username / mac address / IP address for our service desk staff and I can get one line to show but no more. Really don't want them to have to click multiple self service buttons.
Solved
displayMessage line break.
Best answer by rlandgraf
This is the script that I use for this, you may need to edit it if you have a bunch of newer machines that only have wireless.
#!/bin/sh
#en0Address=`ifconfig en0 | grep "inet" | cut -d " " -f2`
en1Status=`ifconfig en1 | tr ' ' '
' | grep "active"`
en0Status=`ifconfig en0 | tr ' ' '
' | grep "active"`
CurrentUser=`who | grep "console" | awk '{print $1}'`
hostnamename=`hostname | cut -d "." -f 1`
computername=`jamf getComputerName | cut -d ">" -f2 | cut -d "<" -f1`
OSVersion=`sw_vers | grep "ProductVersion" | awk '{print $2}'`
en1MACAddress=`ifconfig en1 | grep "ether" | cut -d" " -f2`
en0MACAddress=`ifconfig en0 | grep "ether" | cut -d" " -f2`
TotalRam=`system_profiler SPHardwareDataType | grep "Memory:" | cut -d":" -f2`
BootVolume=`system_profiler SPSoftwareDataType | grep "Boot Volume:" | cut -d":" -f2`
TotalBootDriveSize=`system_profiler SPSerialATADataType | grep "$BootVolume" -A2 | grep "Capacity:" | cut -d ":" -f2 | cut -d "(" -f1`
AvailBootDriveSize=`system_profiler SPSerialATADataType | grep "$BootVolume" -A2 | grep "Available:" | cut -d ":" -f2 | cut -d "(" -f1`
if [ "$en1Status" == "active" ];
then en1Address=`ifconfig en1 | grep "inet " | cut -d " " -f2`
else en1Address="not active"
fi
if [ "$en0Status" == "active" ];
then en0Address=`ifconfig en0 | grep "inet" | cut -d " " -f2`
else en0Address="not active"
fi
jamf displayMessage -message "Wired address is $en0Address
Wireless address is $en1Address
Current Logged on user is $CurrentUser
Computer name is $computername
Hostname is $hostnamename
OS version is $OSVersion
Wired MAC Address is $en0MACAddress
Wireless MAC Address is $en1MACAddress
Total RAM (Memory):$TotalRam
Boot Volume:$BootVolume
Total size:$TotalBootDriveSize
Free space:$AvailBootDriveSize"Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
