1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-15 07:56:36 +00:00

Make startscript apache.sh PREFIX aware at install time,

so it can be called within an path or dir.
e.g. in: /usr/local/etc/rc.local/apache.sh
and in /etc/rc.conf:
local_startup="/usr/local/etc/rc.local"

Approved by:	ache
This commit is contained in:
Dirk Meyer 2002-04-22 03:26:12 +00:00
parent 48fe32279d
commit 995ac1fee4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=57971
2 changed files with 7 additions and 8 deletions

View File

@ -72,13 +72,17 @@ CONFIGURE_ENV= OPTIM='${OPTIM}' LD_SHLIB='${CC}'
MAN1= dbmmanage.1 htdigest.1 htpasswd.1
MAN8= ab.8 apachectl.8 apxs.8 httpd.8 logresolve.8 rotatelogs.8
post-extract:
@${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/apache.sh \
> ${WRKSRC}/apache.sh
pre-install:
PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/apache.sh ]; then \
${ECHO} "Installing ${PREFIX}/etc/rc.d/apache.sh startup file."; \
${INSTALL_SCRIPT} -m 751 ${FILESDIR}/apache.sh ${PREFIX}/etc/rc.d/apache.sh; \
${INSTALL_SCRIPT} -m 751 ${WRKSRC}/apache.sh ${PREFIX}/etc/rc.d/apache.sh; \
fi
@${CAT} ${PKGMESSAGE}

View File

@ -1,16 +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/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev/null && echo -n ' apache'
[ -x %%PREFIX%%/sbin/apachectl ] && %%PREFIX%%/sbin/apachectl start > /dev/null && echo -n ' apache'
;;
stop)
[ -r /var/run/httpd.pid ] && ${PREFIX}/sbin/apachectl stop > /dev/null && echo -n ' apache'
[ -r /var/run/httpd.pid ] && %%PREFIX%%/sbin/apachectl stop > /dev/null && echo -n ' apache'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2