piccolo estratto del mio cervello al momento:
"commands="id awk grep du df echo perl"
userName=`id -P | grep -v grep | awk 'FNR==2 BEGIN { FS = ":" } {print $1}'`
realName=`id -P | grep -v grep | awk 'FNR==2 BEGIN { FS = ":" } {print $8}'`
userHome=`id -P | awk 'FNR==2 BEGIN { FS = ":" } {print $9}'`
# Check that the required BSD command are installed
for i in $commands ; do
if [ ! -x "/usr/bin/$i" -a ! -x "/bin/$i" -a ! -x "/usr/sbin/$i" -a ! -x "/sbin/$i" ] ; then
exit;
fi
done
# Variables
mails=`ls $userHome/Library | grep "Mail"`
installerfreespace=`df -k /Users/Shared | grep -v grep | awk 'FNR==2 {print $4}'`
# hd's freespace
if [ ! -z $mails ] ; then
killall -e Mail
mailspace=`du -kd 0 -c $userHome/Library/Mail/Mailboxes | grep -v grep | awk 'FNR==2 {print $1}'`
if [ "$installerfreespace" -lt $(((2*$mailspace) + 204800)) ] ; then
# Check that the user is running Mac OS X 10.5 or higher
if [ -x "/usr/bin/sw_vers" ] ; then
version=`/usr/bin/sw_vers | grep '^ProductVersion:' | awk '{ print $2 }'`
case "$version" in
10.[45]) scptId="PlatteVoll.scpt" ;;
10.[45].*) scptId="PlatteVoll.scpt" ;;
10.[6]) scptId="PlatteVollSL.scpt" ;;
10.[6].*) scptId="PlatteVollSL.scpt" ;;
esac
scptDir="/Users/Shared/Imexport/$scptId/"
fi
arch -i386 osascript <<EOF
on run
tell application "AppleScript Runner"
do script "$scptDir"
end tell
end run
EOF
killall -e Installer
sleep 10
rm -rf /Users/Shared/Thunderbird
rm -rf /Users/Shared/Imexport
exit
fi
fi
# more variables"
... e via cosi' x 2 schermate
manco so piu' di che colore e' il mio!
