Update mosquitto to 0.15
[openwrt/svn-archive/archive.git] / net / mosquitto / files / mosquitto.init
1 #!/bin/sh /etc/rc.common
2 # Basic init script for mosquitto
3 # April 2012, OpenWrt.org
4 # Provides support for the luci-app-mosquitto package, if installed
5
6 START=80
7 APP=`which mosquitto`
8 USE_UCI_CONFIG=$(uci -q get mosquitto.owrt.use_uci)
9 if [ $? -eq 1 ]; then
10 USE_UCI_CONFIG=0
11 fi
12
13 SERVICE_DAEMONIZE=1
14 SERVICE_WRITE_PID=1
15
16 start() {
17 user_exists mosquitto 200 || user_add mosquitto 200
18 if [ "$USE_UCI_CONFIG" -eq 1 ]; then
19 CONF=/tmp/mosquitto.converted.$$.conf
20 mosquitto.uci.convert -f $CONF
21 else
22 CONF=/etc/mosquitto/mosquitto.conf
23 fi
24 service_start $APP -c $CONF
25 }
26
27 stop() {
28 service_stop $APP
29 }