summaryrefslogtreecommitdiff
path: root/network/users-agent/rc.users-agent
diff options
context:
space:
mode:
authorChristopher Walker <kris240376@gmail.com>2013-05-31 13:53:30 -0300
committerRobby Workman <rworkman@slackbuilds.org>2013-06-04 00:11:08 -0500
commit7b251fe9df3708c1590b031af0daff2378c95dd3 (patch)
treeb7ed4ffa3245f028016f4330ef2c97498f5c921f /network/users-agent/rc.users-agent
parent87bc86f59969ec4fade88658bbde8d7739d002d6 (diff)
downloadslackbuilds-7b251fe9df3708c1590b031af0daff2378c95dd3.tar.gz
network/users-agent: Added (Jabber User Directory)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'network/users-agent/rc.users-agent')
-rw-r--r--network/users-agent/rc.users-agent29
1 files changed, 29 insertions, 0 deletions
diff --git a/network/users-agent/rc.users-agent b/network/users-agent/rc.users-agent
new file mode 100644
index 0000000000..304eca03dc
--- /dev/null
+++ b/network/users-agent/rc.users-agent
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+users_agent_start() {
+ if [ ! -e /var/run/users-agent/jud.pid ]; then
+ su - %JUDUSR% -c "/usr/bin/users-agent -c /etc/users-agent/config.xml &"
+ su - %JUDUSR% -c "ps ux" | awk '/users-agent/ && !/awk/ {print $2}' > /var/run/users-agent/jud.pid
+ fi
+}
+
+users_agent_stop() {
+ kill `cat /var/run/users-agent/jud.pid 2> /dev/null` 2> /dev/null
+ rm -rf /var/run/users-agent/jud.pid 2> /dev/null
+}
+
+case $1 in
+'start')
+ users_agent_start
+ ;;
+'stop')
+ users_agent_stop
+ ;;
+'restart')
+ users_agent_stop
+ sleep 2
+ users_agent_start
+ ;;
+*)
+ echo "usage: `basename $0` {start|stop|restart}"
+esac