#!/bin/bash ############################################################################### # # # IPFire.org - A linux based firewall # # Copyright (C) 2008 Michael Tremer & Christian Schmidt # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation, either version 3 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program. If not, see . # # # ############################################################################### BATCHLOG=$BASEDIR/log_${TARGET}/_build.00-batch.log ############################################################################### # Starts the batch process in the background # ############################################################################### batch_start() { [ "$1" = "--clean" ] && TARGET=$TARGET $0 clean screen -dmS ipfire $0 batch _run } ############################################################################### # Run this to check what is going on in the moment # ############################################################################### batch_attach() { screen -x ipfire if [ "$?" -eq "0" ]; then beautify message DONE else beautify message FAIL fi } ############################################################################### # This is the main batch function that runs one thing after an other # ############################################################################### batch_run() { gettoolchain $0 build | $BASEDIR/tools/tee $BATCHLOG sleep 5 if [ -e $FAILED ]; then SUBJECT="Failed :(" else SUBJECT="Success!" puttarget fi SUBJECT=$SUBJECT batch_mail } ############################################################################### # A function to send an email to the developers # ############################################################################### batch_mail() { MAIL_SUBJECT="[build.ipfire.org - ${HOSTNAME}] - ${SUBJECT}" for i in MAIL_SERVER MAIL_TO MAIL_FROM MAIL_USER MAIL_PASS MAIL_SUBJECT; do [ -n "${!i}" ] && export ${i}="${!i}" done ## Send the email tools/alog2html < $BATCHLOG 2>&1 | tools/sendEmail }