diff options
author | jlam <jlam> | 2001-05-14 21:27:25 +0000 |
---|---|---|
committer | jlam <jlam> | 2001-05-14 21:27:25 +0000 |
commit | ec60e99d199664ad16b228fa3d0867f16872b83d (patch) | |
tree | 489396933249d6415bd911fa17f644ce2b36cef9 /www/apache/files | |
parent | 252cfcad6717f0463d8bff112f507d4326c12055 (diff) | |
download | pkgsrc-ec60e99d199664ad16b228fa3d0867f16872b83d.tar.gz |
Make this look more like databases/postgresql-server/files/pgsql.sh:
Respect /etc/rc.conf.
Handle "force" commands.
Allow overriding of ${name}_flags with ${flags} from environment.
Diffstat (limited to 'www/apache/files')
-rw-r--r-- | www/apache/files/apache.sh | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/www/apache/files/apache.sh b/www/apache/files/apache.sh index 75dd6c8b500..5e159a4b62f 100644 --- a/www/apache/files/apache.sh +++ b/www/apache/files/apache.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: apache.sh,v 1.12 2001/05/08 18:13:51 jlam Exp $ +# $NetBSD: apache.sh,v 1.13 2001/05/14 21:27:25 jlam Exp $ # # PROVIDE: apache # REQUIRE: DAEMON @@ -13,12 +13,27 @@ name="apache" rcvar=$name command="@PREFIX@/sbin/apachectl" +apache_start=start if [ -f @APACHE_SYSCONFDIR@/apache_start.conf ] then # This file can reset apache_start to "startssl" . @APACHE_SYSCONFDIR@/apache_start.conf fi +# set defaults +if [ -r /etc/rc.conf ] +then + . /etc/rc.conf +else + eval ${rcvar}=YES +fi + +# $flags from environment overrides ${rcvar}_flags +if [ -n "${flags}" ] +then + eval ${rcvar}_flags="${flags}" +fi + apache_doit() { action=$1 @@ -29,7 +44,7 @@ apache_doit() restart) echo -n "Restarting ${name}: " ;; esac - ${command} ${command_args} ${action} + ${command} ${apache_flags} ${command_args} ${action} } checkyesno() @@ -45,17 +60,16 @@ checkyesno() esac } -if [ -r /etc/rc.conf ] -then - . /etc/rc.conf -else +cmd=${1:-start} +case ${cmd} in +force*) + cmd=${cmd#force} eval ${rcvar}=YES -fi + ;; +esac if checkyesno ${rcvar} then - cmd=${1:-start} - if [ -x ${command} ] then case ${cmd} in |