diff options
author | Reto Buerki <reet@codelabs.ch> | 2012-12-06 19:03:45 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2013-01-17 15:22:10 +0100 |
commit | 7c2ef58e86c10e0cf9846dc9211cc68c7e908f7f (patch) | |
tree | a25052fa664b62f96b091855e9c1f08e9622701e /testing/scripts/function.sh | |
parent | 261cf0e395ec43634e49e3f431cd189d69f03edc (diff) | |
download | strongswan-7c2ef58e86c10e0cf9846dc9211cc68c7e908f7f.tar.bz2 strongswan-7c2ef58e86c10e0cf9846dc9211cc68c7e908f7f.tar.xz |
Import testing.conf file in function.sh
This is needed to have access to $LOGFILE and possibly other config
settings.
Diffstat (limited to 'testing/scripts/function.sh')
-rwxr-xr-x | testing/scripts/function.sh | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/testing/scripts/function.sh b/testing/scripts/function.sh index a04490aec..3e0560a46 100755 --- a/testing/scripts/function.sh +++ b/testing/scripts/function.sh @@ -14,6 +14,21 @@ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. +export TERM=xterm +RED=$(tput setaf 1) +GREEN=$(tput setaf 2) +NORMAL=$(tput op) + +# exit with given error message +# $1 - error message +die() { + echo -e "${RED}$1${NORMAL}" + exit 1 +} + +[ -f testing.conf ] || die "Configuration file 'testing.conf' not found" +. testing.conf + # execute command # $1 - command to execute # $2 - whether or not to log command exit status @@ -40,11 +55,6 @@ execute_chroot() execute "chroot $LOOPDIR $@" } -export TERM=xterm -RED=$(tput setaf 1) -GREEN=$(tput setaf 2) -NORMAL=$(tput op) - function cecho { echo -e "\033[1;31m$1\033[0m" } @@ -76,13 +86,6 @@ log_status() echo } -# exit with given error message -# $1 - error message -die() { - echo -e "${RED}$1${NORMAL}" - exit 1 -} - ############################################# # search and replace strings throughout a # whole directory |