diff options
author | Andreas Maunz <andreas@maunz.de> | 2011-03-29 14:07:32 +0200 |
---|---|---|
committer | Andreas Maunz <andreas@maunz.de> | 2011-03-29 14:07:32 +0200 |
commit | 9ac9100ef477fbe3e98a5d0c57d2def5b84bdd75 (patch) | |
tree | 69ba96ac1b6805438ea0614976ca039c0c8b264d /opentox-webservices.sh | |
parent | 32b7c10610616d3c6321b8d28f26dbad7a6057a2 (diff) |
opentox-webservices
Diffstat (limited to 'opentox-webservices.sh')
-rwxr-xr-x | opentox-webservices.sh | 62 |
1 files changed, 39 insertions, 23 deletions
diff --git a/opentox-webservices.sh b/opentox-webservices.sh index 294b9bf..8fe8a1f 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -1,23 +1,37 @@ -#!/bin/sh - -echo "Installing OpenTox webservices" -. ./config -# Create opentox system user -id opentox -if [ $? -ne 0 ] -then - adduser --system opentox +#!/bin/bash +# +# Installs Opentox Webservices. +# Author: Christoph Helma, Andreas Maunz. +# + +if [ "$(id -u)" = "0" ]; then + echo "This script must be run as non-root." 1>&2 + exit 1 +fi + +# Utils +WGET="`which wget`" +if [ ! -e "$WGET" ]; then + echo "'wget' missing. Install 'wget' first. Aborting..." + exit 1 fi -dir=`pwd` -mkdir -p /var/www/opentox -cd /var/www/opentox +source ./config.sh + +echo "This installs Opentox webservices." +echo "Press <Return> to continue, or <Ctrl+C> to abort." +read + +DIR=`pwd` + +mkdir -p "$WWW_DEST/opentox" +cd "$WWW_DEST/opentox" for s in compound dataset algorithm model toxcreate task; do - git clone git://github.com/opentox/$s.git $s - cd $s - git checkout -t origin/$branch - mkdir -p public - ln -s /var/www/opentox/$s/public /var/www/$s + git clone "git://github.com/opentox/$s.git" "$s" + cd "$s" + git checkout -t origin/development # AM: use development + mkdir public + ln -s "$WWW_DEST/opentox/$s/public" "$WWW_DEST/$s" cd - done @@ -30,10 +44,12 @@ done #ln -s /var/www/opentox/validation/public /var/www/validation # fminer etc -cd /var/www/opentox/algorithm -updatedb +cd $WWW_DEST/opentox/algorithm +echo "Need root password:" +sudo updatedb rake fminer:install -chown -R opentox /var/www/opentox -cp -r $HOME/.opentox /home/opentox/ -chown -R opentox /home/opentox/.opentox -cd $dir +cp -r "$HOME/.opentox" "$HOME" + +cd "$DIR" +echo +echo "Opentox installation finished." |