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.

29 lines
680 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. user_exists mosquitto 200 || user_add mosquitto 200
  15. if [ "$USE_UCI_CONFIG" -eq 1 ]; then
  16. CONF=/tmp/mosquitto.converted.$$.conf
  17. mosquitto.uci.convert -f $CONF
  18. else
  19. CONF=/etc/mosquitto/mosquitto.conf
  20. fi
  21. service_start $APP -c $CONF
  22. }
  23. stop() {
  24. service_stop $APP
  25. }