+ if [ "$2" = "SVNUPDATE" ]; then
+ SUBJECT="SVNUPDATE: IPFIRE-BUILD R$SVN_REVISION on `hostname`"
+ echo "ERROR: $0 svn up!"
+ cat <<END > /tmp/ipfire_mail_body
+When I was downloading the latest svn source,
+I have found an ERROR!
+Here you can see the logs and detect the reason for this error.
+
+Best Regards
+Your IPFire-Build-Script
+END
+ fi
+
+ if [ "$2" = "SVNDIST" ]; then
+ SUBJECT="SVNDIST: IPFIRE-BUILD R$SVN_REVISION on `hostname`"
+ echo "ERROR: $0 svn dist!"
+ cat <<END > /tmp/ipfire_mail_body
+When I was exporting the latest svn source,
+I have found an ERROR!
+Here you can see the logs and detect the reason for this error.
+
+Best Regards
+Your IPFire-Build-Script
+END
+ fi
+
+ if [ "$2" = "PREFETCH" ]; then
+ SUBJECT="PREFETCH: IPFIRE-BUILD R$SVN_REVISION on `hostname`"
+ echo "ERROR: $0 prefetch!"
+ cat <<END > /tmp/ipfire_mail_body
+When I was downloading the source packages,
+I have found an ERROR!
+Here you can see the logs and detect the reason for this error.
+
+Best Regards
+Your IPFire-Build-Script
+END
+ fi
+
+ if [ "$2" = "ISO" ]; then
+ SUBJECT="ISO: IPFIRE-BUILD R$SVN_REVISION on `hostname`"
+ echo "ERROR: $0 upload iso!"
+ cat <<END > /tmp/ipfire_mail_body
+When I was uploading the iso image,
+I have found an ERROR!
+Here you can see the logs and detect the reason for this error.
+
+Best Regards
+Your IPFire-Build-Script
+END
+ fi
+
+ if [ "$2" = "PAKS" ]; then
+ SUBJECT="PAKS: IPFIRE-BUILD R$SVN_REVISION on `hostname`"
+ echo "ERROR: $0 upload paks!"
+ cat <<END > /tmp/ipfire_mail_body
+When I was uploading the packages,
+I have found an ERROR!
+Here you can see the logs and detect the reason for this error.
+
+Best Regards
+Your IPFire-Build-Script
+END
+ fi
+
+ tar cfz $ATTACHMENT log/_build*
+ cat <<END >> /tmp/ipfire_mail_body
+
+Here is a summary... The full logs are in the attachment.
+---------------------------------------------------------
+
+`tail log/_*`
+END
+ cat /tmp/ipfire_mail_body | tools/sendEmail -q \
+ -f $IPFIRE_MAIL_FROM \
+ -t $IPFIRE_MAIL_REPORT \
+ -u $SUBJECT \
+ -s $IPFIRE_MAIL_SERVER:25 \
+ -xu $IPFIRE_MAIL_USER \
+ -xp $IPFIRE_MAIL_PASS \
+ -l log/_build.mail.log \
+ -a $ATTACHMENT # -v
+ rm -f /tmp/ipfire_mail_body $ATTACHMENT