summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/flufigut-client.sh14
-rwxr-xr-xsrc/manage.sh10
2 files changed, 18 insertions, 6 deletions
diff --git a/src/flufigut-client.sh b/src/flufigut-client.sh
index e62a465..7cb0c54 100755
--- a/src/flufigut-client.sh
+++ b/src/flufigut-client.sh
@@ -64,8 +64,6 @@ if [ "install" = "$1" ]; then
fi
remove_instance() {
- type="$1"
- name="$2"
if [ "$1" = "worker" ]; then
sudo -u flumotion rm "$CONF_DIR/workers/$2.xml"
elif [ "$1" = "manager" ]; then
@@ -91,9 +89,8 @@ param=`echo $SSH_ORIGINAL_COMMAND | awk '{ print $2 }'`
case "$command" in
install)
- echo -n "install files from $param ... "
- cd $CONF_DIR
- sudo -u flumotion tar --strip-components=2 -xzf "$param"
+ echo -n "install files from '$param' ... "
+ sudo -u flumotion tar -C "$CONF_DIR" --strip-components=2 -xzf "$param"
rm "$param"
echo "done."
;;
@@ -106,6 +103,13 @@ case "$command" in
done
echo "ok."
;;
+ wipe)
+ echo -n "wiping files ... "
+ sudo -u flumotion rm "$CONF_DIR/workers/$param-"*.xml 2> /dev/null
+ sudo -u flumotion rm -rf "$CONF_DIR/managers/$param/" 2> /dev/null
+ sudo -u flumotion rm "$CONF_DIR/$param.passwd" 2> /dev/null
+ echo "done."
+ ;;
start)
echo -n "starting ... "
while read line; do
diff --git a/src/manage.sh b/src/manage.sh
index 92596af..29d0c85 100755
--- a/src/manage.sh
+++ b/src/manage.sh
@@ -65,6 +65,13 @@ clean_all() {
done
}
+wipe_all() {
+ for machine in `grep "^Host" ssh.config | awk '{ print($2) }'`; do
+ echo "wipeing files belonging to planet '$1' from $machine ... "
+ ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" wipe "$1"
+ done
+}
+
generate_instance_list() {
machine=$1
@@ -135,9 +142,10 @@ case "$1" in
wipe)
if [ -z "$2" ]; then
echo "Usage: $0 wipe <planet name>"
+ exit 1
fi
echo "wipeing configuration for from all machines inside ssh-config ..."
- wipe_all
+ wipe_all "$2"
;;
start)
echo "Start manager and worker on all machines ..."