summaryrefslogtreecommitdiff
path: root/src/flufigut-client.sh
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2012-10-16 02:21:33 +0200
committerChristian Pointner <equinox@spreadspace.org>2012-10-16 02:21:33 +0200
commit70fdcf95d1ff3c002f496516ab59e4c23d655262 (patch)
tree698a281f64dbdf099e21d31efabbdfef7448e045 /src/flufigut-client.sh
parentupdated TODO (diff)
flufigut clean works now
Diffstat (limited to 'src/flufigut-client.sh')
-rwxr-xr-xsrc/flufigut-client.sh36
1 files changed, 27 insertions, 9 deletions
diff --git a/src/flufigut-client.sh b/src/flufigut-client.sh
index aad3a06..e62a465 100755
--- a/src/flufigut-client.sh
+++ b/src/flufigut-client.sh
@@ -56,25 +56,34 @@ if [ "install" = "$1" ]; then
echo 'command="/usr/local/bin/flufigut-client.sh",no-X11-forwarding,no-agent-forwarding,no-port-forwarding '$pubkey > /var/lib/flufigut/.ssh/authorized_keys
chown -R flufigut:flufigut /var/lib/flufigut/.ssh
chmod 600 /var/lib/flufigut/.ssh/authorized_keys
- echo "flufigut ALL = (flumotion) NOPASSWD: $DAEMON, /bin/tar" >> /etc/sudoers
+ echo "flufigut ALL = (flumotion) NOPASSWD: $DAEMON, /bin/tar, /bin/rm" >> /etc/sudoers
fi
echo "successfully installed flufigut client."
exit 0
fi
+remove_instance() {
+ type="$1"
+ name="$2"
+ if [ "$1" = "worker" ]; then
+ sudo -u flumotion rm "$CONF_DIR/workers/$2.xml"
+ elif [ "$1" = "manager" ]; then
+ sudo -u flumotion rm -rf "$CONF_DIR/managers/$2/"
+ sudo -u flumotion rm "$CONF_DIR/$2.passwd"
+ else
+ echo "WARN: ignorng unknown type $1"
+ fi
+}
+
start_instance() {
- type="$1"
- name="$2"
- sudo -u flumotion $DAEMON $DAEMON_ARGS start $type $name
- return "$?"
+ sudo -u flumotion $DAEMON $DAEMON_ARGS start "$1" "$2"
+ return "$?"
}
stop_instance() {
- type="$1"
- name="$2"
- sudo -u flumotion $DAEMON $DAEMON_ARGS stop $type $name
- return "$?"
+ sudo -u flumotion $DAEMON $DAEMON_ARGS stop "$1" "$2"
+ return "$?"
}
command=`echo $SSH_ORIGINAL_COMMAND | awk '{ print $1 }'`
@@ -88,6 +97,15 @@ case "$command" in
rm "$param"
echo "done."
;;
+ remove)
+ echo -n "removing files ... "
+ while read line; do
+ type=`echo $line | awk '{ print $1 }'`
+ name=`echo $line | awk '{ print $2 }'`
+ remove_instance $type $name
+ done
+ echo "ok."
+ ;;
start)
echo -n "starting ... "
while read line; do