diff options
Diffstat (limited to 'www/apache')
-rw-r--r-- | www/apache/files/apache.sh | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/www/apache/files/apache.sh b/www/apache/files/apache.sh index 3b69568e607..605b9c4a56f 100644 --- a/www/apache/files/apache.sh +++ b/www/apache/files/apache.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: apache.sh,v 1.16 2002/02/05 06:04:42 jlam Exp $ +# $NetBSD: apache.sh,v 1.17 2002/02/26 20:28:41 jlam Exp $ # # PROVIDE: apache # REQUIRE: DAEMON @@ -18,23 +18,40 @@ name="apache" rcvar=$name command="@PREFIX@/sbin/httpd" ctl_command="@PREFIX@/sbin/apachectl" +required_files="@PKG_SYSCONFDIR@/httpd.conf" +start_cmd="apache_doit start" +stop_cmd="apache_doit stop" +restart_cmd="apache_doit restart" +# "${apache_start}" is the subcommand sent to apachectl to control how +# httpd is started. It's value may be overridden in: +# +# @PKG_SYSCONFDIR@/apache_start.conf +# /etc/rc.conf +# /etc/rc.conf.d/apache, +# +# in order of increasing precedence. Its possible values are "start" +# and "startssl", and defaults to "start". +# apache_start=start if [ -f @PKG_SYSCONFDIR@/apache_start.conf ] then - # This file can reset apache_start to "startssl" . @PKG_SYSCONFDIR@/apache_start.conf fi -required_files="@PKG_SYSCONFDIR@/httpd.conf" -start_cmd="${ctl_command} ${apache_start}" -stop_cmd="${ctl_command} stop" -restart_cmd="${ctl_command} restart" +apache_doit () +{ + case $1 in + start) action=${apache_start} ;; + *) action=$1 ;; + esac + ${ctl_command} ${action} +} if [ -f /etc/rc.subr ] then load_rc_config $name run_rc_command "$1" else - ${start_cmd} + eval ${start_cmd} fi |