Disable the init script by default to avoid log pollution; motion is
very verbose when it cannot open the configured camera.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
PKG_NAME:=motion
PKG_VERSION:=4.2.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
PKG_LICENSE:=GPLv2
endef
define Package/motion/conffiles
+/etc/config/motion
/etc/motion.conf
endef
--without-webp
define Package/motion/install
- $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
+ $(INSTALL_CONF) ./files/motion.conf $(1)/etc/config/motion
+ $(INSTALL_BIN) ./files/motion.init $(1)/etc/init.d/motion
$(CP) $(PKG_BUILD_DIR)/motion-dist.conf $(1)/etc/motion.conf
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/motion $(1)/usr/bin/
--- /dev/null
+config motion general
+ option enabled '0'
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+START=94
+USE_PROCD=1
+
+PROG="/usr/bin/motion"
+CONF="/etc/motion.conf"
+
+start_service() {
+ local enabled
+
+ config_load "motion"
+ config_get_bool enabled "general" "enabled" 0
+ [ "$enabled" -gt 0 ] || return 1
+
+ procd_open_instance
+
+ procd_set_param command "$PROG"
+ procd_append_param command -c "$CONF"
+
+ procd_close_instance
+}