main ()␊ |
{␊ |
␉echo "==============================================="␊ |
␉echo "set com.apple.Boot.plist options"␊ |
␉echo "****************************************"␊ |
␉echo "set com.apple.Boot.plist variables"␊ |
␉echo "**********************************"␊ |
␊ |
␉temp="/private/tmp/Chameleon"␊ |
␉echo "Temp is ${temp}"␊ |
␊ |
␉bootplist="${3}/.Chameleon/Extra/com.apple.Boot.plist"␊ |
␉echo "bootplist = ${bootplist}"␉␊ |
␊ |
␉systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist"␊ |
␉echo "systemplist= ${systemplist}"␊ |
␊ |
␉echo "if no directory exists named ${bootplist%/*} then mkdir ${bootplist%/*}"␊ |
␉[ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}"␊ |
␊ |
␉if [ ! -f "${bootplist}" ]; then␊ |
␉␉echo "${bootplist} doesn't exist"␊ |
␉␉if [ -f "${systemplist}" ]; then␊ |
␉␉␉echo "${systemplist} doesn't exist"␊ |
␉␉␉echo "copy ${systemplist} to ${bootplist}"␊ |
␉␉␉cp "${systemplist}" "${bootplist}"␊ |
␉␉fi␊ |
␉fi␊ |
␉echo "-----------------------------------------------"␊ |
␉echo ""␊ |
␉echo ""␊ |
␊ |
␊ |
␉echo "==============================================="␊ |
␉echo "Build Extra/com.apple.Boot.plist"␊ |
␉echo "********************************"␊ |
␊ |
␉cd ${temp}␊ |
␉Dirlist=$(find . -type d | grep "/")␊ |
␉for directory in $Dirlist ; do␊ |
␉␉overide=$(echo $directory | sed 's/_/ /g' | tr -d "./@" |cut -d '+' -f1)␊ |
␉␉string=$(echo $directory | tr -d "./@" |cut -d'+' -f2)␊ |
␊ |
␉␉bootplist="${3}/.Chameleon/Extra/com.apple.Boot.plist"␊ |
␉␉echo "bootplist = ${bootplist}"␉␊ |
␊ |
␉␉systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist"␊ |
␉␉echo "systemplist= ${systemplist}"␊ |
␉␉echo ""␊ |
␊ |
␉␉bootoptionshdextra[1]="<key>${overide}</key>"␊ |
␉␉bootoptionshdextra[2]="<string>${string}</string>"␊ |
␉␉echo "bootoptionshdextra 1 = ${bootoptionshdextra[1]}"␊ |
␉␉echo "bootoptionshdextra 2= ${bootoptionshdextra[2]}"␊ |
␉␉echo ""␊ |
␊ |
␉␉echo "if no directory exists named ${bootplist%/*} then mkdir ${bootplist%/*}"␊ |
␉␉echo ""␊ |
␉␉[ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}"␊ |
␉␉#echo "bootoptionshdextra 1 = ${bootoptionshdextra[1]}"␊ |
␉␉#echo "bootoptionshdextra 2= ${bootoptionshdextra[2]}"␊ |
␉␊ |
␉␉echo "if ${bootplist} doesn't exist"␊ |
␉␉echo ""␊ |
␉␉if [ ! -f "${bootplist}" ]; then␊ |
␉␉␉echo "if ${systemplist} doesn't exist"␊ |
␉␉␉echo ""␊ |
␉␉␉if [ -f "${systemplist}" ]; then␊ |
␉␉␉␉echo "copy ${systemplist} to ${systemplist}"␊ |
␉␉␉␉echo ""␊ |
␉␉␉␉cp "${systemplist}" "${bootplist}"␊ |
␉␉␉fi␊ |
␉␉fi␊ |
␉␊ |
␉␉xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" )␊ |
␉␉echo "xmlvalue = ${xmlvalue}"␊ |
␉␉echo ""␊ |
␊ |
␉␉case "${xmlvalue:0:1}" in␊ |
␉␉␉␉␊ |
|
␉␉␉␉;;␊ |
␉␉esac␊ |
␊ |
␉␉echo "set owner privileges for ${bootplist}"␊ |
␉␉#echo "set owner privileges for ${bootplist}"␊ |
␉␉chown "${USER}:20" "${bootplist}"␊ |
␉done␊ |
␊ |
␉echo "-----------------------------------------------"␊ |
␉echo ""␊ |
␉echo ""␊ |
}␊ |
␊ |
getxmlvalue ()␊ |