diff options
author | jedgar <jedgar@FreeBSD.org> | 2000-07-14 01:55:13 +0000 |
---|---|---|
committer | jedgar <jedgar@FreeBSD.org> | 2000-07-14 01:55:13 +0000 |
commit | df1f78d4befe3b5050493f8c152b2ef65816ddae (patch) | |
tree | 49d6308686743cddd48f23f625e9e10c351e9836 /www/fhttpd | |
parent | f7c5356da38e1c9372cba089e71bac528e69bc87 (diff) | |
download | FreeBSD-ports-df1f78d4befe3b5050493f8c152b2ef65816ddae.zip FreeBSD-ports-df1f78d4befe3b5050493f8c152b2ef65816ddae.tar.gz |
Convert startup script to {start|stop} usage
Diffstat (limited to 'www/fhttpd')
-rw-r--r-- | www/fhttpd/Makefile | 2 | ||||
-rw-r--r-- | www/fhttpd/files/fhttpd.sh | 20 |
2 files changed, 19 insertions, 3 deletions
diff --git a/www/fhttpd/Makefile b/www/fhttpd/Makefile index 49579c6..29ab310 100644 --- a/www/fhttpd/Makefile +++ b/www/fhttpd/Makefile @@ -23,13 +23,11 @@ pre-patch: pre-install: ${RM} -rf ${WRKSRC}/http-root/pub/dummy_directory - ${PERL} -pi -e "s:/usr/local:${PREFIX}:g" ${WRKSRC}/fhttpd.sh ${PERL} -pi -e "s:%%LOGFILE%%:${PREFIX}/${LOGFILE}:g" ${WRKSRC}/fhttpd.sh ${PERL} -pi -e "s:/usr/local:${PREFIX}:g" ${WRKSRC}/http-root/root-fhttpd.conf ${PERL} -pi -e "s:%%LOGFILE%%:${PREFIX}/${LOGFILE}:g" ${WRKSRC}/http-root/root-fhttpd.conf do-install: - ${MKDIR} ${PREFIX}/etc/rc.d ${INSTALL_SCRIPT} ${WRKSRC}/fhttpd.sh ${PREFIX}/etc/rc.d .for PROG in fhttpd fhttpd-file fhttpd-log ${INSTALL_PROGRAM} ${WRKSRC}/${PROG} ${PREFIX}/sbin diff --git a/www/fhttpd/files/fhttpd.sh b/www/fhttpd/files/fhttpd.sh index 51bbd8b..916f6e7 100644 --- a/www/fhttpd/files/fhttpd.sh +++ b/www/fhttpd/files/fhttpd.sh @@ -1,2 +1,20 @@ #!/bin/sh -[ -x /usr/local/sbin/fhttpd ] && /usr/local/sbin/fhttpd -c /usr/local/etc/fhttpd.conf -l /usr/local/share/fhttpd/fhttpd.log >/dev/null 2>&1 && echo -n " fhttpd" + +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/fhttpd ] && ${PREFIX}/sbin/fhttpd -c ${PREFIX}/etc/fhttpd.conf -l ${PREFIX}/share/fhttpd/fhttpd.log > /dev/null 2>&1 && echo -n ' fhttpd' + ;; +stop) + killall fhttpd && echo -n ' fhttpd' + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 |