mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-05 22:43:24 +00:00
aa85e6e0da
Changes (from PR): - japanese/ndtpd o Set default syslog file for `/var/log/ndtpd.log'. o Change the default working directory `/var/ndtpd' to `/var/run/ndtpd'. * It will created by `${PREFIX}/etc/rc.d/ndtpd.sh' (even if the user select "Inetd mode" !) * Lock files and a PID file are created under it. o Support some arguments in the startup script: ${PREFIX}/etc/rc.d/ndtpd.sh start|stop|kill|restart|status|terminate o Separate the session to build `ndtpd.sh.sample' from `post-install' into `post-build'. o Don't configure EB sybsystem in NDTPD. - japanese/eb o Don't configure ZLIB sybsystem in EB. o Don't define CONFIGURE_ENV. * Suggested by Michael's last commit to japanese/ndtpd/Makefile. PR: 16117 Submitted by: Kazu TAKAMUNE <takamune@avrl.mei.co.jp>
50 lines
967 B
Bash
50 lines
967 B
Bash
#!/bin/sh -e -
|
|
# startup script for ndtpd
|
|
|
|
# Usage: ndtpd.sh [kill|restart|status|terminate|stop|start]
|
|
|
|
command=$1
|
|
standalone=YES # Run ndtpd as a standalone daemon.
|
|
#standalone=NO # Run ndtpd as a child of inetd.
|
|
|
|
GetDirective() {
|
|
directive=$1
|
|
|
|
awk '/^[ ]*'${directive}'[ ]+/ {print $2; exit}' ${conf}
|
|
}
|
|
|
|
MakeWorkingDirectory() {
|
|
user="`GetDirective user`"
|
|
group="`GetDirective group`"
|
|
work="`GetDirective work-path`"
|
|
|
|
rm -rf ${work:=@rundir@/ndtpd}
|
|
eval install -d ${user:+-o ${user}} ${group:+-g ${group}} ${work}
|
|
}
|
|
|
|
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
|
|
|
|
case "${command}" in
|
|
kill|restart|status|terminate)
|
|
eval ${ctrl} ${command};;
|
|
|
|
stop)
|
|
eval ${ctrl} terminate;;
|
|
|
|
start|*)
|
|
MakeWorkingDirectory
|
|
eval ${start};;
|
|
esac
|
|
|
|
exit
|