diff options
Diffstat (limited to 'services-install')
-rwxr-xr-x | services-install | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/services-install b/services-install new file mode 100755 index 0000000..9165b9e --- /dev/null +++ b/services-install @@ -0,0 +1,42 @@ +#!/bin/bash + +SELF=$(basename $0 -install) +[ "`id -u`" = "0" ] && echo "This script must be run as non-root." 1>&2 && exit 1 + +# Adjust ruby version here! +RUBY_NUM_VER="1.9.3-p194" + +echo +echo "Welcome to service installation (<Return> to continue)." +read delete_me + + +# check wd is root of service +DIR=`pwd` +if echo $DIR | grep "$SELF/bin" >/dev/null 2>&1 ; then cd ..; fi + +# # # Boot the script + +# load base config, helper funs, environment +OT_CONFIG_DIR="$HOME/.opentox" +! [ -f "$OT_CONFIG_DIR/config/install/config.sh" ] && echo "config.sh not found." 1>&2 && exit 1 || . $OT_CONFIG_DIR/config/install/config.sh +! [ -f "$OT_PREFIX/install/utils.sh" ] && echo "utils.sh not found." 1>&2 && exit 1 || . $OT_PREFIX/install/utils.sh +[ -f $OT_CONFIG_DIR/opentox-ui.sh ] && . $OT_CONFIG_DIR/opentox-ui.sh # should have been done by user already +RUBY_DIR="$HOME/.rbenv/versions/$RUBY_NUM_VER" + + +# # # Install + +LOG="$OT_PREFIX/tmp/services.log" +check_utils "rbenv find" +echo +echo "Installation ('$LOG'):" +echo + +[ "`$RBENV local 2>/dev/null`" = "$RUBY_NUM_VER" ] || install_ruby + + +for SERVICE in opentox-client opentox-server dataset algorithm; do + install_ot_service +done +cd $DIR |