packages/net/prosody/files/prosody.init
swalker 38673a0736 [packages] prosody: update to 0.6.2, add an init script, enable the posix module and logging, use PKG_INSTALL
git-svn-id: svn://svn.openwrt.org/openwrt/packages@21536 3c298f89-4303-0410-b956-a3cf2f4a3e73
2010-05-23 03:00:30 +00:00

33 lines
558 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2010 OpenWrt.org
START=99
EXTRA_COMMANDS="status"
EXTRA_HELP=" status Print the status of the service"
BIN=/usr/bin/prosodyctl
LOG_D=/var/log/prosody
RUN_D=/var/run/prosody
PID_F=$RUN_D/prosody.pid
RUN_USER=prosody
RUN_GROUP=prosody
start() {
[ -d $LOG_D ] || ( mkdir -p $LOG_D && chown $RUN_USER:$RUN_GROUP $LOG_D )
[ -d $RUN_D ] || ( mkdir -p $RUN_D && chown $RUN_USER:$RUN_GROUP $RUN_D )
$BIN start
}
stop() {
$BIN stop
}
reload() {
[ -f $PID_F ] && kill -HUP $(cat $PID_F)
}
status() {
$BIN status
}