tftpd-hpa: fix premature exit

standalone daemon exits as recipe installs file as tftpd-hpa

* Changed script so it can consult /etc/default, as daemon name may be
 subject to change.
* Changed the default name to match the recipe

Signed-off-by: David Turgeon <david.turgeon@gmail.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
This commit is contained in:
David Turgeon
2013-10-12 10:04:00 -04:00
committed by Joe MacDonald
parent d56605b3fe
commit d96c23b4cb
@@ -18,20 +18,21 @@ set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="HPA's tftpd" DESC="HPA's tftpd"
NAME=in.tftpd NAME=in.tftpd-hpa
DAEMON=/usr/sbin/$NAME
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/tftpd-hpa SCRIPTNAME=/etc/init.d/tftpd-hpa
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
# Read config file if it is present. # Read config file if it is present.
if [ -r /etc/default/tftpd-hpa ] if [ -r /etc/default/tftpd-hpa ]
then then
. /etc/default/tftpd-hpa . /etc/default/tftpd-hpa
fi fi
DAEMON=/usr/sbin/$NAME
PIDFILE=/var/run/$NAME.pid
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
if [ "$RUN_DAEMON" != "yes" ] ; then if [ "$RUN_DAEMON" != "yes" ] ; then
echo "tftpd-hpa disabled in /etc/default/tftpd-hpa" echo "tftpd-hpa disabled in /etc/default/tftpd-hpa"
exit 0 exit 0