From a53c3c2621a67674d105f0afa40f6dfd15cbbd78 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 24 Aug 2012 15:37:36 +0200 Subject: [PATCH] minidlna: Add initscript and all the other fancy install stuff. --- config/rootfiles/common/armv5tel/initscripts | 1 + config/rootfiles/common/i586/initscripts | 1 + config/rootfiles/packages/minidlna | 1 + src/initscripts/init.d/minidlna | 48 ++++++++++++++++++++ src/paks/minidlna/install.sh | 32 +++++++++++++ src/paks/minidlna/uninstall.sh | 27 +++++++++++ src/paks/minidlna/update.sh | 25 ++++++++++ 7 files changed, 135 insertions(+) create mode 100755 src/initscripts/init.d/minidlna create mode 100644 src/paks/minidlna/install.sh create mode 100644 src/paks/minidlna/uninstall.sh create mode 100644 src/paks/minidlna/update.sh diff --git a/config/rootfiles/common/armv5tel/initscripts b/config/rootfiles/common/armv5tel/initscripts index eaa6352d74..c23416692c 100644 --- a/config/rootfiles/common/armv5tel/initscripts +++ b/config/rootfiles/common/armv5tel/initscripts @@ -47,6 +47,7 @@ etc/rc.d/init.d/mISDN #etc/rc.d/init.d/mediatomb #etc/rc.d/init.d/messagebus #etc/rc.d/init.d/miau +#etc/rc.d/init.d/minidlna #etc/rc.d/init.d/miniupnpd #etc/rc.d/init.d/mldonkey etc/rc.d/init.d/modules diff --git a/config/rootfiles/common/i586/initscripts b/config/rootfiles/common/i586/initscripts index 882628afd8..63cd27448d 100644 --- a/config/rootfiles/common/i586/initscripts +++ b/config/rootfiles/common/i586/initscripts @@ -48,6 +48,7 @@ etc/rc.d/init.d/mISDN #etc/rc.d/init.d/mediatomb #etc/rc.d/init.d/messagebus #etc/rc.d/init.d/miau +#etc/rc.d/init.d/minidlna #etc/rc.d/init.d/miniupnpd #etc/rc.d/init.d/mldonkey etc/rc.d/init.d/modules diff --git a/config/rootfiles/packages/minidlna b/config/rootfiles/packages/minidlna index e53330e923..c30e30b406 100644 --- a/config/rootfiles/packages/minidlna +++ b/config/rootfiles/packages/minidlna @@ -1,2 +1,3 @@ +etc/rc.d/init.d/minidlna etc/minidlna.conf usr/sbin/minidlna diff --git a/src/initscripts/init.d/minidlna b/src/initscripts/init.d/minidlna new file mode 100755 index 0000000000..682306760b --- /dev/null +++ b/src/initscripts/init.d/minidlna @@ -0,0 +1,48 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/minidlna +# +# Description : minidlna - UPNP/DLNA streaming server +# +# Authors : Michael Tremer +# +# Version : 01.00 +# +######################################################################## + +. /etc/sysconfig/rc +. ${rc_functions} + +case "${1}" in + start) + boot_mesg "Starting minidlna..." + loadproc /usr/sbin/minidlna + ;; + + stop) + boot_mesg "Stopping minidlna..." + killproc /usr/sbin/minidlna + ;; + + reload) + boot_mesg "Reloading minidlna..." + reloadproc /usr/sbin/minidlna + ;; + + restart) + ${0} stop + sleep 1 + ${0} start + ;; + + status) + statusproc /usr/sbin/minidlna + ;; + + *) + echo "Usage: ${0} {start|stop|reload|restart|status}" + exit 1 + ;; +esac + +# End $rc_base/init.d/minidlna diff --git a/src/paks/minidlna/install.sh b/src/paks/minidlna/install.sh new file mode 100644 index 0000000000..5080157cd9 --- /dev/null +++ b/src/paks/minidlna/install.sh @@ -0,0 +1,32 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_files +[ -d /var/mp3 ] || ( mkdir /var/mp3 && chown nobody.nobody /var/mp3 ) + +start_service ${NAME} + +ln -svf ../init.d/minidlna /etc/rc.d/rc0.d/K00minidlna +ln -svf ../init.d/minidlna /etc/rc.d/rc3.d/S99minidlna +ln -svf ../init.d/minidlna /etc/rc.d/rc6.d/K00minidlna diff --git a/src/paks/minidlna/uninstall.sh b/src/paks/minidlna/uninstall.sh new file mode 100644 index 0000000000..bc59838434 --- /dev/null +++ b/src/paks/minidlna/uninstall.sh @@ -0,0 +1,27 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +stop_service ${NAME} +remove_files +rm -rf /etc/rc.d/rc*.d/*minidlna diff --git a/src/paks/minidlna/update.sh b/src/paks/minidlna/update.sh new file mode 100644 index 0000000000..d5e61164c9 --- /dev/null +++ b/src/paks/minidlna/update.sh @@ -0,0 +1,25 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +./uninstall.sh +./install.sh -- 2.39.5