aboutsummaryrefslogtreecommitdiff
path: root/package/ejabberd/S50ejabberd
blob: 265630712dc03ddf3f8563f42a60095f69de78c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
#
# Start/stop ejabberd
#

USER=ejabberd
RUNDIR=/var/run/ejabberd

mkrundir() {
    install -d -o $USER -g $USER $RUNDIR
}

case "$1" in
    start)
	mkrundir
        echo "Starting ejabberd..."
        ejabberdctl start
        ;;
    stop)
        echo -n "Stopping ejabberd... "
        ejabberdctl stop > /dev/null
        if [ $? -eq 3 ] || ejabberdctl stopped; then
            echo "OK"
        else
            echo "failed"
        fi
        ;;
    restart|reload)
        "$0" stop
        "$0" start
        ;;
    *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac