summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authordavor <vorgrimmlerdavid@gmx.de>2012-08-09 18:30:07 +0200
committerdavor <vorgrimmlerdavid@gmx.de>2012-08-09 18:30:07 +0200
commit523275b0e30412078a33d618dcb5a6f077716376 (patch)
tree21a68cd190ede658c404ed9b088f60676bf07f2f /bin
parentf965db794d27cf5f298fb2fc276da1cf829cd985 (diff)
Added bin/installer.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/opentox-client-install59
1 files changed, 59 insertions, 0 deletions
diff --git a/bin/opentox-client-install b/bin/opentox-client-install
new file mode 100755
index 0000000..48905ca
--- /dev/null
+++ b/bin/opentox-client-install
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# Installs Opentox Webservice.
+# Author: Christoph Helma, Andreas Maunz.
+
+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/`basename $0`.log"
+check_utils "rbenv find"
+echo
+echo "Installation ('$LOG'):"
+echo
+
+# ruby
+[ "`$RBENV local 2>/dev/null`" = "$RUBY_NUM_VER" ] || install_ruby
+
+# self
+echo
+install_with_bundler
+
+echo
+echo "Installation finished."
+echo
+echo "IMPORTANT: How to configure your system:"
+echo "IMPORTANT: a) Include '$OT_UI_CONF' in shell startup (e.g. ~/.bashrc)."
+echo "IMPORTANT: b) Manually source '$OT_UI_CONF' every time."
+echo "IMPORTANT: The command in both cases: '. $OT_UI_CONF'"
+echo "IMPORTANT: NOW would be the best time to configure!"
+echo
+echo "Thank you for your attention."
+echo
+
+# return to wd
+cd "$DIR"