Mit der folgenden Funktion kann ermittelt werden, wieviele Apps installiert sind (inkl. den Sub-Apps eines Programmes). Für alle Apps aus dem App-Store kann noch erkannt werden, ob ein Update zur Verfügung steht. Ebenfalls ist Bestandteil der Funktion die Überprüfung der UPdate-Einstellungen für den App-Store.

SECTION13 ()
{
local file1=/Library/Preferences/com.apple.commerce
local file1_exists=0
local file2=/Library/Preferences/com.apple.SoftwareUpdate.plist
local file2_exists=0


local entry1=`${def_cr}com.apple.commerce | grep "AutoUpdate =" | wc -l`
local entry2=`${def_cr}com.apple.SoftwareUpdate.plist | grep "AutomaticDownload =" | wc -l`
local entry3=`${def_cr}com.apple.SoftwareUpdate.plist | grep "ConfigDataInstall =" | wc -l`
local entry4=`${def_cr}com.apple.SoftwareUpdate.plist | grep "CriticalUpdateInstall =" | wc -l`
local entry5=`${def_cr}com.apple.SoftwareUpdate.plist | grep "ConfigDataInstall =" | wc -l`
local entry6=`find / -iname *.app | wc -l`
local entry7=`find /Applications -path '*Contents/_MASReceipt/receipt' -maxdepth 6 -print | wc -l`


if [ -e "${file1}" ]; then file1_exists=1; fi
if [ -e "${file2}" ]; then file2_exists=1; fi

echo "\n" >>${SUMMARY_FILE}
echo "\t reading settings for - Update Apple software" | tee -a ${SUMMARY_FILE}
if [ ${file1_exists} == "1" ]; then
echo "${file1} is present" | tee -a ${SUMMARY_FILE}
if [ ${entry1} == "1" ]; then
${def_cr}com.apple.commerce | grep "AutoUpdate =" | tee -a ${SUMMARY_FILE}
else
echo "entry AutoUpdate is not present" | tee -a ${SUMMARY_FILE}
fi
else
echo "${file1} is not present" | tee -a ${SUMMARY_FILE}
fi
###


echo "\n" >>${SUMMARY_FILE}
echo "\t reading settings for - Enable updates download in background" | tee -a ${SUMMARY_FILE}
if [ ${file2_exists} == "1" ]; then
echo "${file2} is present" | tee -a ${SUMMARY_FILE}
if [ ${entry2} == "1" ]; then
${def_cr}com.apple.SoftwareUpdate.plist | grep "AutomaticDownload =" | tee -a ${SUMMARY_FILE}
else
echo "entry AutomaticDownload is not present" | tee -a ${SUMMARY_FILE}
fi
else
echo "${file2} is not present" | tee -a ${SUMMARY_FILE}
fi
###


echo "\n" >>${SUMMARY_FILE}
echo "\t reading settings for - Enable system data updates" | tee -a ${SUMMARY_FILE}
if [ ${file2_exists} == "1" ]; then
echo "${file2} is present" | tee -a ${SUMMARY_FILE}
if [ ${entry3} == "1" ]; then
${def_cr}com.apple.SoftwareUpdate.plist | grep "ConfigDataInstall =" | tee -a ${SUMMARY_FILE}
else
echo "entry ConfigDataInstall is not present" | tee -a ${SUMMARY_FILE}
fi
else
echo "${file2} is not present" | tee -a ${SUMMARY_FILE}
fi
###


echo "\n" >>${SUMMARY_FILE}
echo "\t reading settings for - Enable system security updates" | tee -a ${SUMMARY_FILE}
if [ ${file2_exists} == "1" ]; then
echo "${file2} is present" | tee -a ${SUMMARY_FILE}
if [ ${entry4} == "1" ]; then
${def_cr}com.apple.SoftwareUpdate.plist | grep "CriticalUpdateInstall =" | tee -a ${SUMMARY_FILE}
else
echo "entry CriticalUpdateInstall is not present" | tee -a ${SUMMARY_FILE}
fi
else
echo "${file2} is not present" | tee -a ${SUMMARY_FILE}
fi
###


echo "\n" >>${SUMMARY_FILE}
echo "\t testing for missing updates" | tee -a ${SUMMARY_FILE}
if [ ${file2_exists} == "1" ]; then
echo "${file2} is present" | tee -a ${SUMMARY_FILE}
if [ ${entry5} != "0" ]; then
${def_cr}com.apple.SoftwareUpdate.plist | grep "LastUpdatesAvailable =" | tee -a ${SUMMARY_FILE}
else
echo "entry LastUpdatesAvailable is not present" | tee -a ${SUMMARY_FILE}
fi
else
echo "${file2} is not present" | tee -a ${SUMMARY_FILE}
fi
###

echo "\n" >>${SUMMARY_FILE}
echo "\t Are there updates?" | tee -a ${SUMMARY_FILE}
softwareupdate -l | tee -a ${SUMMARY_FILE}
###


echo "\n" >>${SUMMARY_FILE}
echo "\t find all applications on the system" | tee -a ${SUMMARY_FILE}
echo "on the system are ${entry6} application present" | tee -a ${SUMMARY_FILE}
find / -iname *.app | tee -a ${SUMMARY_FILE}
###


echo "\n" >>${SUMMARY_FILE}
echo "\t find all applications insatlled from app-store" | tee -a ${SUMMARY_FILE}
echo "on the system are ${entry6} application present and ${entry7} installed from App-Store" | tee -a ${SUMMARY_FILE}
find /Applications -path '*Contents/_MASReceipt/receipt' -maxdepth 4 -print | sed 's#.app/Contents/_MASReceipt/receipt#.app#g; s#/Applications/##' | tee -a ${SUMMARY_FILE}

}
###

##
# section 13
##
GEN_SUMMARY_SEPARATOR
echo " M 2.478 Planung des sicheren Einsatzes von Mac OS X" | tee -a ${SUMMARY_FILE}
echo " M 2.479 Planung der Sicherheitsrichtlinien von Mac OS X" | tee -a ${SUMMARY_FILE}
echo " M 4.371 Konfiguration von Mac OS X Clients" | tee -a ${SUMMARY_FILE}
echo " J.13. Software Updates" | tee -a ${SUMMARY_FILE}
SECTION13

Zum Seitenanfang