You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
620 B

  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. START=80
  6. APP=`which mosquitto`
  7. USE_UCI_CONFIG=$(uci -q get mosquitto.owrt.use_uci)
  8. if [ $? -eq 1 ]; then
  9. USE_UCI_CONFIG=0
  10. fi
  11. SERVICE_DAEMONIZE=1
  12. SERVICE_WRITE_PID=1
  13. start() {
  14. if [ "$USE_UCI_CONFIG" -eq 1 ]; then
  15. CONF=/tmp/mosquitto.converted.$$.conf
  16. mosquitto.uci.convert -f $CONF
  17. else
  18. CONF=/etc/mosquitto/mosquitto.conf
  19. fi
  20. service_start $APP -c $CONF
  21. }
  22. stop() {
  23. service_stop $APP
  24. }