summaryrefslogtreecommitdiffstats
path: root/sbin/init.d/squid
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2006-07-16 15:09:46 +0200
committerWilly Tarreau <willy@wtap.(none)>2006-07-26 12:03:28 +0200
commitfaff05383ae2a99c326dc3994cfa449caa777a34 (patch)
tree551e5c0fce63724cab0a5ea85b1aa5501ef89b4d /sbin/init.d/squid
parent[RELEASE] init-scripts-0.3.8 (diff)
downloadinit-scripts-0.3.9.tar.gz
[RELEASE] init-scripts-0.3.9v0.3.9
Diffstat (limited to 'sbin/init.d/squid')
-rwxr-xr-xsbin/init.d/squid43
1 files changed, 43 insertions, 0 deletions
diff --git a/sbin/init.d/squid b/sbin/init.d/squid
new file mode 100755
index 0000000..cdb32f1
--- /dev/null
+++ b/sbin/init.d/squid
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+. `dirname $0`/functions
+
+option config standard_option /etc/opt/squid/squid.conf
+option httpport standard_option
+option icpport standard_option
+option usesyslog boolean_option 0
+option createswap boolean_option 0
+option catchsignals boolean_option 1
+option dnstest boolean_option 1
+option waitrebuild boolean_option 0
+option reuseaddr boolean_option 1
+option doublecheck boolean_option 0
+option vhostaccel boolean_option 0
+option bin reserved_option /opt/sbin/squid
+
+function fct_end_section {
+ local chroot
+ # try to find pidfile from the config file if unspecified
+ if [ -z "$pidfile" ]; then
+ valueof ${opt_config:-/etc/opt/squid/squid.conf} chroot >/dev/null 2>&1
+ chroot=$REPLY
+ valueof ${opt_config:-/etc/opt/squid/squid.conf} pid_filename >/dev/null 2>&1
+ pidfile=$chroot/${REPLY:-/var/log/squid.pid}
+ pidfile=${pidfile//\/\//\/} # clear double slashes
+ fi
+
+ # let's add the options to the command line
+ cmdline="$cmdline ${opt_config:+-f $opt_config} ${opt_httpport:+-a $opt_httpport}"
+ cmdline="$cmdline ${opt_icpport:+-u $opt_icpport}"
+ [ "$opt_usesyslog" = "1" ] && cmdline="$cmdline -s"
+ [ "$opt_createswap" = "1" ] && cmdline="$cmdline -z"
+ [ "$opt_catchsignals" != "1" ] && cmdline="$cmdline -C"
+ [ "$opt_dnstest" != "1" ] && cmdline="$cmdline -D"
+ [ "$opt_reuseaddr" != "1" ] && cmdline="$cmdline -R"
+ [ "$opt_waitrebuild" = "1" ] && cmdline="$cmdline -F"
+ [ "$opt_doublecheck" = "1" ] && cmdline="$cmdline -S"
+ [ "$opt_vhostaccel" = "1" ] && cmdline="$cmdline -V"
+}
+
+load_config
+