Posted on 03-19-2010 11:48 AM
I have a UNIX command I can feed to our Macs that returns value of 0 or 1.
Using the defaults read command on a plist reports the output. I use awk to just show me that a machine has 0 or 1.
My question is, is there a way to have Casper report that info or store it?
The values represent if a certain preference is enabled or not. It would help me better figure out if users have something enabled. Thanks.
Posted on 03-19-2010 12:11 AM
Sure, you can use a dummy package. You could case your 0 or 1 output and on
each case run a touch command. Look at the script below as an example. I
wanted to find out if a machine had a GUID partition table or Apple
partition table. Casper will recon the dummy package as a regular piece of
Casper-installed software and you can scope on that receipt's presense, for
instance.
j
#!/bin/sh
############################################################################
####################
##### Filename: getPartitionTable.sh
#####
##### Author: Jared F. Nichols
#####
##### Purpose: Get the type of the partition table and touch down a dummy
package for it #####
#####
#####
############################################################################
####################
rm -rf /Library/Application Support/JAMF/Receipts/Apple Partition
Table.pkg
rm -rf /Library/Application Support/JAMF/Receipts/GUID Partition
Table.pkg
PartitionType=diskutil list | grep 0:
case $PartitionType in
*Apple_partition_scheme)
touch /Library/Application Support/JAMF/Receipts/Apple Partition
Table.pkg
;;
*GUID_partition_scheme)
touch /Library/Application Support/JAMF/Receipts/GUID Partition
Table.pkg
;;
esac
exit 0