- ncftpls -u web3 -p $PASS ftp://mirror.ipfire.org/html/source-packages/beta/ | grep `svn info | grep Revision | cut -c 11-`
- if [ "$?" -eq "1" ]; then
- cp $BASEDIR/ipfire-install-1.4.i386.iso $BASEDIR/ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso
- md5sum ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso > ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso.md5
- ncftpput -u web3 -p $PASS mirror.ipfire.org /html/source-packages/beta/ ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso
- ncftpput -u web3 -p $PASS mirror.ipfire.org /html/source-packages/beta/ ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso.md5
- if [ "$?" -eq "0" ]; then
- echo -e "The ISO of Revision `svn info | grep Revision | cut -c 11-` was successfully uploaded to the ftp server."
- else
- echo -e "There was an error while uploading the ISO to the ftp server."
- fi
- else
- echo -e "File with name ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso already exists on the ftp server!"
+ if [ "$2" = "SUCCESS" ]; then
+ SUBJECT="SUCCESS: IPFIRE-BUILD R$SVN_REVISION on `hostname`"
+ cat <<END > /tmp/ipfire_mail_body
+Building IPFire on `hostname` in Revision $SVN_REVISION was successfull!
+You can find the ISO on your ftp server.
+
+Statistics:
+-----------
+Started: $IPFIRE_START_TIME
+Finished: `date`
+
+Best Regards
+Your IPFire-Build-Script
+END
+ fi
+ 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