From d2bf668856c63e2682aba0df3a504a1bac6ec7f3 Mon Sep 17 00:00:00 2001 From: davor Date: Mon, 21 Nov 2011 12:57:53 +0100 Subject: Installer stores tmp files in $HOME/tmp and backups the existing system. --- install | 31 ++++++++++++++++++++++++++++--- kernlab.sh | 4 ++-- nginx.sh | 2 +- openbabel.sh | 10 +++++----- opentox-ruby.sh | 2 +- opentox-webservices.sh | 2 +- redis.sh | 2 +- ruby.sh | 8 ++++---- 8 files changed, 43 insertions(+), 18 deletions(-) diff --git a/install b/install index 9dee38c..88ef63e 100755 --- a/install +++ b/install @@ -7,7 +7,32 @@ if [ "$(id -u)" = "0" ]; then exit 1 fi -LOG="/tmp/`basename $0`-log.txt" +echo +echo "Warning! If all IST services are stoppped press return, else to stop installation." +echo "Note: Your data will be backupped." +read help_var +echo + +mkdir -p $HOME/tmp/ +if [ -f "$HOME/.opentox-ui.sh" ] +then + mv -b -v $HOME/.opentox-ui.sh $HOME/.opentox-ui.sh~ +else + echo "$HOME/.opentox-ui.sh does not exist." +fi +if [ -d "$HOME/.opentox" ] +then + mv -b -v -T $HOME/.opentox $HOME/.opentox~ +else + echo "$HOME/.opentox does not exist." +fi +if [ -d "$HOME/opentox-ruby" ] +then + mv -b -v -T $HOME/opentox-ruby $HOME/opentox-ruby~ +else + echo "$HOME/opentox-ruby does not exist." +fi +LOG="$HOME/tmp/`basename $0`-log.txt" . "./utils.sh" echo echo "Opentox-ruby installation." @@ -15,8 +40,8 @@ echo "You may need to give root password for some privileged actions right now a echo cmd="sudo echo -n \"\"" && run_cmd "$cmd" "Acquire privileges" -echo "Cleaning up /tmp files." -sudo rm -rf /tmp/openbabel* /tmp/kernlab* /tmp/ruby* +echo "Cleaning up $HOME/tmp files." +rm -rf $HOME/tmp/openbabel* $HOME/tmp/kernlab* $HOME/tmp/ruby* . "./base-install.sh" . "./ruby.sh" diff --git a/kernlab.sh b/kernlab.sh index 2fba2a8..511874b 100755 --- a/kernlab.sh +++ b/kernlab.sh @@ -26,7 +26,7 @@ if [ ! -e "$R" ]; then fi # Pkg -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Kernlab ('$LOG')." @@ -46,7 +46,7 @@ fi if ! $R_DONE; then - cd /tmp + cd $HOME/tmp URI="http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_$KL_VER.tar.gz" cmd="$WGET $URI" && run_cmd "$cmd" "Download" diff --git a/nginx.sh b/nginx.sh index ed8a3df..cb8c6b6 100755 --- a/nginx.sh +++ b/nginx.sh @@ -26,7 +26,7 @@ if [ ! -e "$GIT" ]; then fi -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Nginx ('$LOG'):" diff --git a/openbabel.sh b/openbabel.sh index 3d45f00..3016d95 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -21,7 +21,7 @@ if [ ! -e "$WGET" ]; then fi # Pkg -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Openbabel ('$OB_DEST', '$LOG'):" @@ -38,13 +38,13 @@ else fi if [ ! $OB_DONE ]; then - cd "/tmp">>$LOG 2>/dev/null + cd "$HOME/tmp">>$LOG 2>/dev/null URI="http://downloads.sourceforge.net/project/openbabel/openbabel/$OB_NUM_VER/$OB_VER.tar.gz?use_mirror=kent" - if ! [ -d "/tmp/$OB_VER" ]; then + if ! [ -d "$HOME/tmp/$OB_VER" ]; then cmd="$WGET $URI" && run_cmd "$cmd" "Download" cmd="tar zxf $OB_VER.tar.gz?use_mirror=kent $OB_VER" && run_cmd "$cmd" "Unpack" fi - cd "/tmp/$OB_VER">>$LOG 2>/dev/null + cd "$HOME/tmp/$OB_VER">>$LOG 2>/dev/null cmd="./configure --prefix=$OB_DEST" && run_cmd "$cmd" "Configure" cmd="make" && run_cmd "$cmd" "Make" @@ -87,7 +87,7 @@ else fi if ! $OB_DONE ; then - OB_SRC_DIR="/tmp/$OB_VER/scripts/ruby/" + OB_SRC_DIR="$HOME/tmp/$OB_VER/scripts/ruby/" cd "$OB_SRC_DIR" cmd="ruby extconf.rb --with-openbabel-include=$OB_DEST/include/openbabel-2.0 --with-openbabel-lib=$OB_DEST/lib" && run_cmd "$cmd" "Code" cmd="make" && run_cmd "$cmd" "Make" diff --git a/opentox-ruby.sh b/opentox-ruby.sh index ec7f5c2..9705682 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -33,7 +33,7 @@ fi # Pkg -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Opentox-ruby ('$LOG'):" diff --git a/opentox-webservices.sh b/opentox-webservices.sh index c4fbd16..cc53d04 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -37,7 +37,7 @@ if [ ! -e "$RUBY" ]; then exit 1 fi -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Webservices ('$LOG'):" diff --git a/redis.sh b/redis.sh index ad3b695..f07d119 100755 --- a/redis.sh +++ b/redis.sh @@ -19,7 +19,7 @@ if [ ! -e "$WGET" ]; then exit 1 fi -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Redis ('$LOG'):" diff --git a/ruby.sh b/ruby.sh index a1b8cbe..2e53384 100755 --- a/ruby.sh +++ b/ruby.sh @@ -21,7 +21,7 @@ if [ ! -e "$WGET" ]; then fi # Pkg -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Ruby Enterprise edition ('$RUBY_DEST', '$LOG')." @@ -38,13 +38,13 @@ else fi if [ ! $RUBY_DONE ]; then - cd /tmp + cd $HOME/tmp URI="http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" - if ! [ -d "/tmp/$RUBY_VER" ]; then + if ! [ -d "$HOME/tmp/$RUBY_VER" ]; then cmd="$WGET $URI" && run_cmd "$cmd" "Download" cmd="tar xzf $RUBY_VER.tar.gz" && run_cmd "$cmd" "Unpack" fi - cmd="sh /tmp/$RUBY_VER/installer --dont-install-useful-gems --no-dev-docs --auto=$RUBY_DEST" && run_cmd "$cmd" "Install" + cmd="sh $HOME/tmp/$RUBY_VER/installer --dont-install-useful-gems --no-dev-docs --auto=$RUBY_DEST" && run_cmd "$cmd" "Install" fi -- cgit v1.2.3