Fix startup-script for -current /bin/sh issues, and set PREFIX during

install.

Requested by:	obrien
This commit is contained in:
Anders Nordby 2002-08-13 21:39:47 +00:00
parent 29370d3dee
commit 1d3d4ec459
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=64476
2 changed files with 6 additions and 6 deletions

View file

@ -20,6 +20,7 @@ MAINTAINER= anders@FreeBSD.org
IGNOREFILES= notes.html
GNU_CONFIGURE= yes
USE_REINPLACE= yes
MAN1= makeweb.1 htpasswd.1
MAN8= thttpd.8 redirect.8 ssi.8 syslogtocern.8
@ -61,6 +62,7 @@ do-install:
@if [ ! -f ${PREFIX}/etc/rc.d/thttpd.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/thttpd.sh startup file."; \
${INSTALL_SCRIPT} -m 751 ${FILESDIR}/thttpd.sh ${PREFIX}/etc/rc.d/thttpd.sh; \
${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${PREFIX}/etc/rc.d/thttpd.sh; \
fi
.if !defined(NOPORTDOCS)
@${MKDIR} ${PREFIX}/share/doc/thttpd

View file

@ -1,13 +1,11 @@
#!/bin/sh
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
case "$1" in
start)
[ -x ${PREFIX}/sbin/thttpd_wrapper ] && ${PREFIX}/sbin/thttpd_wrapper & && echo -n ' thttpd'
if [ -x %%PREFIX%%/sbin/thttpd_wrapper ]; then
%%PREFIX%%/sbin/thttpd_wrapper &
echo -n ' thttpd'
fi
;;
stop)
kill `cat /var/run/thttpd_wrapper.pid` && killall thttpd && echo -n ' thttpd'