Thursday, 13 March 2014

Apple: Get Values of Properties From PLIST File With UNIX Command

The UNIX command below allows you to get the value of the properties from a PLIST file.
#!/bin/bash -e

Data=`defaults read /Library/Server/Caching/Logs/LastState | grep "TotalBytesFromOrigin" | awk '{print $3}'|cut -d ';' -f 1`
echo "0:$Data:OK"
* Note: The output from the script can be read by Paessler PRTG.

No comments:

Post a Comment