mirror of
https://github.com/Ponce/slackbuilds
synced 2024-12-01 01:00:03 +01:00
1719935dac
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
40 lines
879 B
Bash
40 lines
879 B
Bash
#!/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
|