From 341812cff313361bd82a62e6609d4bb6955eed59 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 6 Jan 2021 23:04:14 +0100 Subject: [PATCH] - add minidlna to image --- make/ni.mk | 1 + make/target-tools.mk | 4 +++ skel-root/general/scripts/minidlnad.init | 39 ++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 skel-root/general/scripts/minidlnad.init diff --git a/make/ni.mk b/make/ni.mk index f9825b99..73301022 100644 --- a/make/ni.mk +++ b/make/ni.mk @@ -69,6 +69,7 @@ ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd2 hd5x hd6x vusolo4k vuduo4k vuduo4ks $(MAKE) bash $(MAKE) iperf $(MAKE) minicom + $(MAKE) minidlna $(MAKE) mc endif ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd5x hd6x vusolo4k vuduo4k vuduo4kse vuultimo4k vuzero4k vuuno4k vuuno4kse vuduo)) diff --git a/make/target-tools.mk b/make/target-tools.mk index d9cebd15..9ee5b962 100644 --- a/make/target-tools.mk +++ b/make/target-tools.mk @@ -917,6 +917,10 @@ minidlna: $(MINIDLNA_DEPS) $(DL_DIR)/$(MINIDLNA_SOURCE) | $(TARGET_DIR) $(MAKE) install DESTDIR=$(TARGET_DIR) $(INSTALL_DATA) -D $(PKG_BUILD_DIR)/minidlna.conf $(TARGET_sysconfdir)/minidlna.conf $(SED) 's|^media_dir=.*|media_dir=A,/media/sda1/music\nmedia_dir=V,/media/sda1/movies\nmedia_dir=P,/media/sda1/pictures|' $(TARGET_sysconfdir)/minidlna.conf + $(SED) 's|^#user=.*|user=root|' $(TARGET_sysconfdir)/minidlna.conf + $(SED) 's|^#friendly_name=.*|friendly_name=$(BOXMODEL):ReadyMedia|' $(TARGET_sysconfdir)/minidlna.conf + $(INSTALL_EXEC) -D $(TARGET_FILES)/scripts/minidlnad.init $(TARGET_sysconfdir)/init.d/minidlnad + $(UPDATE-RC.D) minidlnad defaults 75 25 $(REMOVE)/$(MINIDLNA_DIR) $(TOUCH) diff --git a/skel-root/general/scripts/minidlnad.init b/skel-root/general/scripts/minidlnad.init new file mode 100644 index 00000000..038e1ef5 --- /dev/null +++ b/skel-root/general/scripts/minidlnad.init @@ -0,0 +1,39 @@ +#!/bin/sh + +. /etc/init.d/globals + +start() { + if [ -e /var/etc/.minidlnad ]; then + minidlnad "$@" + fi +} + +stop() { + if [ -e /var/etc/.minidlnad ]; then + kill -TERM $(pidof minidlnad) + fi +} + +restart() { + stop + sleep 1 + start "$@" +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + force-reload) + restart -R + ;; + *) + echo "[$BASENAME] Usage: $0 {start|restart|reload|force-reload|stop}" + ;; +esac