define Package/gmediaserver/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/etc/default
- $(INSTALL_DATA) ./files/$(PKG_NAME).default $(1)/etc/default/$(PKG_NAME)
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
endef
PID_F=$RUN_D/$BIN.pid
start() {
- [ -f $DEFAULT ] && . $DEFAULT
- $BIN $OPTIONS
+ mkdir -p $RUN_D
+ config_load gmediaserver
+ config_foreach start_service gmediaserver
+}
+
+start_service() {
+ local cfg="$1"
+ config_get content_directory "$cfg" content_directory
+ config_get interface "$cfg" interface
+
+ $BIN --background --interface=${interface:-br-lan} --pid-file=$PID_F ${content_directory:-/tmp}
}
stop() {