packages/net/prosody/files/prosody.init
nico a91e83b20f packages/prosody: move user/group creation from postinst to initscript
git-svn-id: svn://svn.openwrt.org/openwrt/packages@28901 3c298f89-4303-0410-b956-a3cf2f4a3e73
2011-11-09 23:17:22 +00:00

42 lines
730 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2010-2011 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() {
user_exists prosody 54 || user_add prosody 54
group_exists prosody 54 || group_add prosody 54
[ -d /var/run/prosody ] || {
mkdir -m 0755 -p /var/run/prosody
chown prosody:prosody /var/run/prosody
}
[ -d /var/log/prosody ] || {
mkdir -m 0755 -p /var/log/prosody
chown prosody:prosody /var/log/prosody
}
$BIN start
}
stop() {
$BIN stop
}
reload() {
[ -f $PID_F ] && kill -HUP $(cat $PID_F)
}
status() {
$BIN status
}