From: Karl Palsson <[email protected]>

Includes support for the luci-app-mosquitto package, if installed.

Signed-off-by: Karl Palsson <[email protected]>
---
 net/mosquitto/Makefile             |    4 ++--
 net/mosquitto/files/mosquitto.init |   13 ++++++++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/net/mosquitto/Makefile b/net/mosquitto/Makefile
index 26d38aa..56f2a64 100644
--- a/net/mosquitto/Makefile
+++ b/net/mosquitto/Makefile
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mosquitto
-PKG_VERSION:=0.14.4
+PKG_VERSION:=0.15
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://mosquitto.org/files/source/
-PKG_MD5SUM:=88750338c2096671c01cf7e461d5c06d
+PKG_MD5SUM:=7ae0ac38f1f379578ab5530e5dc7269e
 
 include $(INCLUDE_DIR)/package.mk
 
diff --git a/net/mosquitto/files/mosquitto.init 
b/net/mosquitto/files/mosquitto.init
index b6ce617..aafa105 100755
--- a/net/mosquitto/files/mosquitto.init
+++ b/net/mosquitto/files/mosquitto.init
@@ -1,16 +1,27 @@
 #!/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
-        service_start $APP -c /etc/mosquitto/mosquitto.conf
+        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() {
-- 
1.7.2.5

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to