packages/net/mosquitto/files/mosquitto.init
jow 9cafbb0791 Update mosquitto to 0.15
Includes support for the luci-app-mosquitto package, if installed.

Signed-off-by: Karl Palsson <karlp@remake.is>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@32564 3c298f89-4303-0410-b956-a3cf2f4a3e73
2012-07-01 11:04:03 +00:00

30 lines
680 B
Bash
Executable File

#!/bin/sh /etc/rc.common
# Basic init script for mosquitto
# April 2012, OpenWrt.org
# Provides support for the luci-app-mosquitto package, if installed
START=80
APP=`which mosquitto`
USE_UCI_CONFIG=$(uci -q get mosquitto.owrt.use_uci)
if [ $? -eq 1 ]; then
USE_UCI_CONFIG=0
fi
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
start() {
user_exists mosquitto 200 || user_add mosquitto 200
if [ "$USE_UCI_CONFIG" -eq 1 ]; then
CONF=/tmp/mosquitto.converted.$$.conf
mosquitto.uci.convert -f $CONF
else
CONF=/etc/mosquitto/mosquitto.conf
fi
service_start $APP -c $CONF
}
stop() {
service_stop $APP
}