diff options
author | mr <mr@mrautenberg.de> | 2011-05-23 13:32:35 +0200 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2011-05-23 13:32:35 +0200 |
commit | 565997933b51f4573b68c2f04ebff82755ea8c74 (patch) | |
tree | a65f1c14b32e36be889f5724be82bfb9c103d684 /utils.sh | |
parent | a8efedb2177909693dbd51409492f8ac8418b3cb (diff) | |
parent | ccdba9f5223d82873b1c653ea3f8635f18fefd0e (diff) |
Merge branch 'release/2.0.0'v2.0.0
Diffstat (limited to 'utils.sh')
-rwxr-xr-x | utils.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/utils.sh b/utils.sh new file mode 100755 index 0000000..880028c --- /dev/null +++ b/utils.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +check_dest() +{ + if ! [ -d "$OT_PREFIX" ]; then + if ! mkdir -p "$OT_PREFIX"; then + echo "Could not create target directory '$OT_PREFIX'! Aborting..." + exit 1 + fi + fi +} + +run_cmd () +{ + local cmd="$1" + local title="$2" + + printf "%30s" "'$title'" + if ! eval $cmd >>$LOG 2>&1 ; then + printf "%50s\n" "FAIL" + echo "Last 10 lines of log:" + tail -10 "$LOG" + exit 1 + fi + printf "%50s\n" "DONE" + +} + +abs_path() +{ + local path="$1" + case "$path" in + /*) absolute=1 ;; + *) absolute=0 ;; + esac +} + +. "`pwd`/config.sh" +touch "$OT_UI_CONF" +. "$OT_UI_CONF" +check_dest |