summaryrefslogtreecommitdiff
path: root/network/jabberd2/rc.jabberd2
diff options
context:
space:
mode:
authorChristopher Walker <kris240376@gmail.com>2013-05-18 11:02:22 -0300
committerRobby Workman <rworkman@slackbuilds.org>2013-06-04 00:11:08 -0500
commit85c888bd322fd938d4b7e91e09b87bbf11c5f17d (patch)
tree47d4cfb045d28f923ea98d09d8044ed97cc1e2ab /network/jabberd2/rc.jabberd2
parentf5c5eb7a1792afa66689ca0003b432bf5d42dfbe (diff)
downloadslackbuilds-85c888bd322fd938d4b7e91e09b87bbf11c5f17d.tar.gz
network/jabberd2: Added (XMPP server)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'network/jabberd2/rc.jabberd2')
-rw-r--r--network/jabberd2/rc.jabberd239
1 files changed, 39 insertions, 0 deletions
diff --git a/network/jabberd2/rc.jabberd2 b/network/jabberd2/rc.jabberd2
new file mode 100644
index 0000000000..5319a8eea8
--- /dev/null
+++ b/network/jabberd2/rc.jabberd2
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+jabberd2_start() {
+ su - %JABBERUSR% -c '/usr/bin/jabberd &'
+}
+
+jabberd2_stop() {
+ if [ -e /var/run/jabberd2/router.pid ]; then
+ kill `cat /var/run/jabberd2/router.pid 2> /dev/null` 2> /dev/null
+ rm /var/run/jabberd2/router.pid
+ fi
+ if [ -e /var/run/jabberd2/c2s.pid ]; then
+ kill `cat /var/run/jabberd2/c2s.pid 2> /dev/null` 2> /dev/null
+ rm /var/run/jabberd2/c2s.pid
+ fi
+ if [ -e /var/run/jabberd2/s2s.pid ]; then
+ kill `cat /var/run/jabberd2/s2s.pid 2> /dev/null` 2> /dev/null
+ rm /var/run/jabberd2/s2s.pid
+ fi
+ if [ -e /var/run/jabberd2/sm.pid ]; then
+ kill `cat /var/run/jabberd2/sm.pid 2> /dev/null` 2> /dev/null
+ rm /var/run/jabberd2/sm.pid
+ fi
+}
+
+case "$1" in
+start)
+ jabberd2_start
+ ;;
+stop)
+ jabberd2_stop
+ ;;
+restart)
+ jabberd2_stop
+ sleep 2
+ jabberd2_start
+*)
+ echo "Usage $0 (start|stop|restart|status)"
+esac