summaryrefslogtreecommitdiff
path: root/src/flufigut-client.sh
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2012-10-13 01:02:51 +0200
committerChristian Pointner <equinox@spreadspace.org>2012-10-13 01:02:51 +0200
commitdacf1cc19617a92268537a1e76a6a426c31072aa (patch)
tree490f2b0e8cf43b57ba4e9ddac78425d4788cd462 /src/flufigut-client.sh
parentbetter handling for passwd file (diff)
added deployment scripts (not finished)
Diffstat (limited to 'src/flufigut-client.sh')
-rwxr-xr-xsrc/flufigut-client.sh85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/flufigut-client.sh b/src/flufigut-client.sh
new file mode 100755
index 0000000..8ac58ce
--- /dev/null
+++ b/src/flufigut-client.sh
@@ -0,0 +1,85 @@
+#!/bin/sh
+#
+# flufigut
+#
+# flufigut, the flumotion configuration utility, is a simple tool
+# that generates flumotion configuration files using pyhton jinja2
+# template engine and simplejson. flufigut generates planet.xml
+# and worker.xml files from configuration templates and an easy to
+# understand representation of the flow structure written in json.
+#
+#
+# Copyright (C) 2012 Christian Pointner <equinox@spreadspace.org>
+# Michael Gebetsroither <michael@mgeb.org>
+#
+# This file is part of flufigut.
+#
+# flufigut is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# any later version.
+#
+# flufigut is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with flufigut. If not, see <http://www.gnu.org/licenses/>.
+#
+
+# INSTALLATION
+# - copy script to /usr/local/bin
+# - add ssh key to authorized keys of flumotion user with options:
+# command="/usr/local/bin/flufigut-client.sh",no-X11-forwarding,no-agent-forwarding,no-port-forwarding
+# -
+
+NAME="flumotion"
+LOGFILE="/var/log/flumotion/service.log"
+DAEMON="/usr/sbin/$NAME"
+DAEMON_ARGS="-d 3 -l $LOGFILE"
+CONF_DIR="/etc/flumotion"
+
+start_instance() {
+ type="$1"
+ name="$2"
+ $DAEMON $DAEMON_ARGS start $type $name
+ return "$?"
+}
+
+stop_instance() {
+ type="$1"
+ name="$2"
+ $DAEMON $DAEMON_ARGS stop $type $name
+ return "$?"
+}
+
+command=`echo $SSH_ORIGINAL_COMMAND | awk '{ print $1 }'`
+param=`echo $SSH_ORIGINAL_COMMAND | awk '{ print $2 }'`
+
+case "$command" in
+ install)
+ echo -n "install files from $param ... "
+ echo "done."
+ ;;
+ start)
+ echo -n "starting ... "
+ echo "ok."
+ ;;
+ stop)
+ echo -n "stopping ... "
+ echo "ok."
+ ;;
+ restart)
+ echo -n "stopping ... "
+ sleep 1
+ echo -n "starting ..."
+ echo "ok."
+ ;;
+ *)
+ echo "Unknown command"
+ exit 1
+ ;;
+esac
+
+exit 0