#!/bin/bash
# This script displays a message that lets the user know that
# His Serial Number, internal IP, username and computer name, best to use through policy
# in self service
#This script Was Written by Shahak Tzarfaty From Wediggit all rights reserved.
serial=$(ioreg -l | grep IOPlatformSerialNumber | awk -F= '{print $2}' | awk '{gsub(/\"|\;/,"")}1')
computerName=$(hostname)
ip=$(ipconfig getifaddr en0)
ip2=$(ipconfig getifaddr en1)
userName=$(stat -f%Su /dev/console)
dialog="Your serial number is: $serial,
Your computer name is: $computerName
Your user name is: $userName
Your internal IP is: $ip $ip2"
description=`echo "$dialog"`
button1="OK"
jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
icon="/path/to/icon"
sudo /usr/local/bin/jamf displayMessage -message "$dialog"