diff options
author | Andreas Maunz <andreas@maunz.de> | 2011-03-31 12:42:16 +0200 |
---|---|---|
committer | Andreas Maunz <andreas@maunz.de> | 2011-03-31 12:42:16 +0200 |
commit | 59f6d70df510eb5e009f71a15ccbf20053ec7975 (patch) | |
tree | 432593286a9307daf895973d0b06121b88712647 | |
parent | 312d93bcc322fa5aca38f38cd266569aaf18b621 (diff) |
all
-rwxr-xr-x | base-install.sh | 6 | ||||
-rwxr-xr-x | kernlab.sh | 5 | ||||
-rwxr-xr-x | nginx.sh | 5 | ||||
-rwxr-xr-x | openbabel.sh | 9 | ||||
-rwxr-xr-x | opentox-ruby.sh | 5 | ||||
-rwxr-xr-x | opentox-webservices.sh | 5 | ||||
-rwxr-xr-x | redis.sh | 5 | ||||
-rwxr-xr-x | ruby.sh | 49 | ||||
-rw-r--r-- | utils.sh | 12 |
9 files changed, 44 insertions, 57 deletions
diff --git a/base-install.sh b/base-install.sh index 27b895a..ea26dea 100755 --- a/base-install.sh +++ b/base-install.sh @@ -73,11 +73,7 @@ fi pack_fail="" for p in $pack_arr; do echo -n "'$p': " - if sudo $APTITUDE install "$p" -y >/dev/null 2>&1; then - printf "%25s%15s\n" "'$p'" "DONE" - else - printf "%25s%15s\n" "'$p'" "FAIL" - fi + cmd="sudo $APTITUDE install $p" && run_cmd "$cmd" "$p" done if [ -n "$pack_fail" ]; then @@ -4,6 +4,9 @@ # Author: Christoph Helma, Andreas Maunz. # +source ./config.sh +source ./utils.sh + if [ "$(id -u)" = "0" ]; then echo "This script must be run as non-root." 1>&2 exit 1 @@ -23,8 +26,6 @@ if [ ! -e "$R" ]; then fi # Pkg -source ./config.sh -source ./utils.sh LOG="/tmp/`basename $0`-log.txt" echo "Kernlab ('$LOG')." @@ -4,6 +4,9 @@ # Author: Christoph Helma, Andreas Maunz. # +source ./config.sh +source ./utils.sh + if [ "$(id -u)" = "0" ]; then echo "This script must be run as non-root." 1>&2 exit 1 @@ -16,8 +19,6 @@ if [ ! -e "$PIN" ]; then exit 1 fi -source ./config.sh -source ./utils.sh LOG="/tmp/`basename $0`-log.txt" echo "Nginx ('$LOG')." diff --git a/openbabel.sh b/openbabel.sh index b30d916..bd607c6 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -5,6 +5,9 @@ # Author: Christoph Helma, Andreas Maunz. # +source ./config.sh +source ./utils.sh + if [ "$(id -u)" = "0" ]; then echo "This script must be run as non-root." 1>&2 exit 1 @@ -18,12 +21,10 @@ if [ ! -e "$WGET" ]; then fi # Pkg -source ./config.sh -source ./utils.sh LOG="/tmp/`basename $0`-log.txt" -echo "Openbabel ('$OB_DEST', '$LOG')" - +echo +echo "Openbabel ('$OB_DEST', '$LOG'):" DIR="`pwd`" diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 00bf8f1..0939635 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -4,6 +4,9 @@ # Author: Christoph Helma, Andreas Maunz. # +source ./config.sh +source ./utils.sh + if [ "$(id -u)" = "0" ]; then echo "This script must be run as non-root." 1>&2 exit 1 @@ -30,8 +33,6 @@ fi # Pkg -source ./config.sh -source ./utils.sh LOG="/tmp/`basename $0`-log.txt" echo "Opentox-ruby ('$LOG'):" diff --git a/opentox-webservices.sh b/opentox-webservices.sh index ac0f95b..3dbcf4e 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -4,6 +4,9 @@ # Author: Christoph Helma, Andreas Maunz. # +source ./config.sh +source ./utils.sh + if [ "$(id -u)" = "0" ]; then echo "This script must be run as non-root." 1>&2 exit 1 @@ -16,8 +19,6 @@ if [ ! -e "$WGET" ]; then exit 1 fi -source ./config.sh -source ./utils.sh LOG="/tmp/`basename $0`-log.txt" echo "Webservices ('$LOG'):" @@ -4,6 +4,9 @@ # Author: Christoph Helma, Andreas Maunz. # +source ./config.sh +source ./utils.sh + if [ "$(id -u)" = "0" ]; then echo "This script must be run as non-root." 1>&2 exit 1 @@ -16,8 +19,6 @@ if [ ! -e "$WGET" ]; then exit 1 fi -source ./config.sh -source ./utils.sh LOG="/tmp/`basename $0`-log.txt" echo "This installs Redis." @@ -1,6 +1,7 @@ #!/bin/bash # # Installs Ruby enterprise edition and passenger gem. +# A configuration file is created and included in your '~.bashrc'. # Pass a ruby version string as first argument to install a specific version (blank for default). # Author: Christoph Helma, Andreas Maunz. # @@ -22,11 +23,8 @@ source ./config.sh source ./utils.sh LOG="/tmp/`basename $0`-log.txt" - -echo "This installs Ruby Enterprise edition." -echo "Your installation directory is '$RUBY_DEST'." -echo "A configuration file is created and you are given the option to have it included in your '~.bashrc'." -echo "Log file is '$LOG'." +echo +echo "Ruby Enterprise edition ('$RUBY_DEST', '$LOG')." DIR="`pwd`" @@ -42,26 +40,18 @@ else fi echo -echo "Installing Ruby:" +echo "Installing:" if [ ! $RUBY_DONE ]; then cd /tmp URI="http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" - if ! $WGET -O - "$URI" 2>>$LOG | tar zxv >>$LOG 2>&1 ; then - printf "%25s%15s\n" "'Download'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Download'" "DONE" - if ! sh "/tmp/$RUBY_VER/installer" --dont-install-useful-gems --no-dev-docs --auto="$RUBY_DEST" >>$LOG 2>&1 ; then - printf "%25s%15s\n" "'Install'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Install'" "DONE" + cmd="$WGET -O - $URI" && run_cmd "$cmd" "Download" + cmd="sh /tmp/$RUBY_VER/installer --dont-install-useful-gems --no-dev-docs --auto=$RUBY_DEST" && run_cmd "$cmd" "Install" fi cd "$DIR" echo -echo "Preparing Ruby:" +echo "Preparing:" if ! [ -f "$RUBY_CONF" ]; then @@ -79,7 +69,7 @@ source "$RUBY_CONF" echo -echo "Installing Passenger:" +echo "Passenger:" GEM="`which gem`" if [ ! -e "$GEM" ]; then echo "'gem' missing. Install 'gem' first. Aborting..." @@ -88,30 +78,13 @@ fi if [ "$PASSENGER_SKIP" != "s" ]; then export PATH="$RUBY_DEST/bin:$PATH" - if ! $GEM sources -a "http://gemcutter.org" >>$LOG 2>&1 ; then - printf "%25s%15s\n" "'Add Gemcutter'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Add Gemcutter'" "DONE" - if ! $GEM sources -r "http://rubygems.org" >>$LOG 2>&1 ; then - printf "%25s%15s\n" "'Add Rubygems'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Add Rubygems'" "DONE" + cmd="$GEM sources -a http://gemcutter.org" && run_cmd "$cmd" "Add Gemcutter" + cmd="$GEM sources -a http://rubygems.org" && run_cmd "$cmd" "Add Rubygems" GEMCONF="gem: --no-ri --no-rdoc" if ! grep "$GEMCONF" $HOME/.gemrc >>$LOG 2>&1; then echo "$GEMCONF" | tee -a $HOME/.gemrc >>$LOG 2>&1 fi - if ! $GEM install passenger >>$LOG 2>&1 ; then - printf "%25s%15s\n" "'Install Passenger'" "FAIL" - exit 1 - fi - printf "%25s%15s\n" "'Install Passenger'" "DONE" - + cmd="$GEM install passenger" && run_cmd "$cmd" "Install Passenger" fi -echo -echo "Ruby Installation finished." - - @@ -9,5 +9,17 @@ function check_dest { fi } +function run_cmd { + local cmd=$1 + local title=$2 + + if ! eval $cmd >>$LOG 2>&1 ; then + printf "%25s%15s\n" "'$title'" "FAIL" + exit 1 + fi + printf "%25s%15s\n" "'$title'" "DONE" + +} + check_dest source ~/.bashrc |