# HG changeset patch # User Severin Gehwolf # Date 1347444886 -7200 # Node ID eea20cd2356b6357a4afffc95a022971fabe4ff5 # Parent 5cd4aaf85d0264f58d8aebbc9f8f57b8b0018c42 Provide simple shell script for remote storage user setup. This is a convenience script. Example usage (on host where storage is supposed to run, and storage binding should be to IP 192.168.0.1): $ mvn clean package $ ./distribution/target/tools/setup_remote_storage.sh 192.168.0.1 \ ./distribution/target This creates an admin user, authenticates as such, creates a user for the thermostat db with username "t" and password "t" and starts storage which binds to 192.168.0.1. After that the agent can be started on remote host as follows: $ ./distribution/target/bin/thermostat agent -d mongodb://192.168.0.1:27518 \ --username t --password t Quick and dirty, but is faster than doing this manually :) Reviewed-by: neugens Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2012-September/003158.html diff -r 5cd4aaf85d02 -r eea20cd2356b distribution/pom.xml --- a/distribution/pom.xml Tue Sep 11 22:59:49 2012 +0200 +++ b/distribution/pom.xml Wed Sep 12 12:14:46 2012 +0200 @@ -132,6 +132,11 @@ bundles.properties + + tools + tools + true + @@ -148,6 +153,7 @@ + diff -r 5cd4aaf85d02 -r eea20cd2356b distribution/tools/setup_remote_storage.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/distribution/tools/setup_remote_storage.sh Wed Sep 12 12:14:46 2012 +0200 @@ -0,0 +1,35 @@ +#!/bin/bash +#set -x + +if [ $# -ne 2 ]; then + echo 1>&2 "usage: $0 " + exit 1 +fi + +STORAGE_IP=$1 + +THERMOSTAT_HOME="$2" +THERMOSTAT_USER="t" +THERMOSTAT_PWD="t" +MONGO_ADMIN_USER="admin" +MONGO_ADMIN_PWD="admin" + +$THERMOSTAT_HOME/bin/thermostat storage --start +cat > /tmp/thermostat_setup.txt < $THERMOSTAT_HOME/storage/db.properties <