From aa19923bc91faf3b2f2e42c72b305f477d63f8f5 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Tue, 29 Aug 2000 20:16:57 +0000 Subject: - Update to the latest version ja-ndtpd-2.3.8 (patched). - Refine startup script. o Be friends with `/etc/rc.shutdown'. o Accept only standard arguments. o Add a $FreeBSD$ keyword. PR: ports/20836 Submitted by: Kazu TAKAMUNE (MAINTAINER) --- japanese/ebnetd/files/ndtpd.sh.sample | 41 ++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'japanese/ebnetd/files/ndtpd.sh.sample') diff --git a/japanese/ebnetd/files/ndtpd.sh.sample b/japanese/ebnetd/files/ndtpd.sh.sample index bbf4f41b7508..0db8c8db6c9a 100644 --- a/japanese/ebnetd/files/ndtpd.sh.sample +++ b/japanese/ebnetd/files/ndtpd.sh.sample @@ -1,19 +1,25 @@ #!/bin/sh -e - +# +# $FreeBSD$ +# # startup script for ndtpd - -# Usage: ndtpd.sh [kill|restart|status|terminate|stop|start] +# Usage: ndtpd.sh {start|stop} command=$1 standalone=YES # Run ndtpd as a standalone daemon. #standalone=NO # Run ndtpd as a child of inetd. GetDirective() { + local directive + directive=$1 awk '/^[ ]*'${directive}'[ ]+/ {print $2; exit}' ${conf} } MakeWorkingDirectory() { + local user group work + user="`GetDirective user`" group="`GetDirective group`" work="`GetDirective work-path`" @@ -24,26 +30,25 @@ MakeWorkingDirectory() { conf=@prefix@/etc/ndtpd.conf -[ -f ${conf} ] || exit -ndtpcheck || exit - -if [ "${standalone}" = YES ]; then - ctrl=ndtpcontrol - start="echo -n ' ndtpd'; ndtpd" -else - ctrl="echo 'Error: inetd invokes ndtpd.' >&2; false" -fi +ndtpcheck -c ${conf} || exit case "${command}" in -kill|restart|status|terminate) - eval ${ctrl} ${command};; +start) + MakeWorkingDirectory + if [ "${standalone}" = YES ]; then + ndtpd && echo -n " ndtpd" + fi + ;; stop) - eval ${ctrl} terminate;; - -start|*) - MakeWorkingDirectory - eval ${start};; + if [ "${standalone}" = YES ]; then + ndtpcontrol terminate && echo -n " ndtpd" + fi + ;; +*) + echo "usage: `basename $0` {start|stop}" >&2 + exit 22 + ;; esac exit -- cgit v1.2.3