aboutsummaryrefslogtreecommitdiff
path: root/www/squid32/files/squid.in
diff options
context:
space:
mode:
Diffstat (limited to 'www/squid32/files/squid.in')
-rw-r--r--www/squid32/files/squid.in62
1 files changed, 30 insertions, 32 deletions
diff --git a/www/squid32/files/squid.in b/www/squid32/files/squid.in
index 6768057c655e..6565dfcbcc45 100644
--- a/www/squid32/files/squid.in
+++ b/www/squid32/files/squid.in
@@ -40,45 +40,26 @@
# use. See squid(8) for further details.
#
-squid_checkrunning() {
- ${command} ${command_args} ${squid_flags} -k check 2>/dev/null
-}
-
-squid_setfib() {
- sysctl net.fibs >/dev/null 2>&1 || return 0
- if [ "x${squid_fib}" != "xNONE" ]; then
- command="setfib -F ${squid_fib} ${command}"
- else
- return 0
- fi
-}
-
-squid_stop() {
- echo "Stopping ${name}."
- ${command} ${command_args} ${squid_flags} -k shutdown
- run_rc_command poll
-}
-
. /etc/rc.subr
name=squid
rcvar=squid_enable
+load_rc_config ${name}
+
+: ${squid_chdir:=/var/squid}
+: ${squid_conf:=%%PREFIX%%/etc/squid/squid.conf}
+: ${squid_enable:=NO}
+: ${squid_fib:=NONE}
+: ${squid_pidfile:=/var/run/squid/squid.pid}
+: ${squid_user:=squid}
+
command=%%PREFIX%%/sbin/squid
extra_commands=reload
reload_cmd="${command} ${command_args} ${squid_flags} -k reconfigure"
-start_precmd="squid_setfib"
-stop_precmd="squid_checkrunning"
-stop_cmd="squid_stop"
-
-load_rc_config ${name}
-
-squid_chdir=${squid_chdir:-"/var/squid"}
-squid_conf=${squid_conf:-"%%PREFIX%%/etc/squid/squid.conf"}
-squid_enable=${squid_enable:-"NO"}
-squid_fib=${squid_fib:-"NONE"}
-squid_pidfile=${squid_pidfile:-"/var/run/squid/squid.pid"}
-squid_user=${squid_user:-"squid"}
+start_precmd=squid_setfib
+stop_precmd="${command} ${command_args} ${squid_flags} -k check 2>/dev/null"
+stop_cmd=squid_stop
pidfile=${squid_pidfile}
procname=squid-1
@@ -94,4 +75,21 @@ required_files=${squid_conf}
command_args="-f ${squid_conf}"
-run_rc_command "$1"
+squid_setfib()
+{
+ sysctl net.fibs >/dev/null 2>&1 || return 0
+ if [ "x${squid_fib}" != "xNONE" ]; then
+ command="setfib -F ${squid_fib} ${command}"
+ else
+ return 0
+ fi
+}
+
+squid_stop()
+{
+ echo "Stopping ${name}."
+ ${command} ${command_args} ${squid_flags} -k shutdown
+ run_rc_command poll
+}
+
+run_rc_command $1