diff options
author | Jonas Smedegaard <dr@jones.dk> | 2004-08-15 13:38:16 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2004-08-15 13:38:16 +0000 |
commit | 723447cac474647f388d51704a70d6ec5c8f787a (patch) | |
tree | fce39491aaad3a0d82e94282e4a12a25348817af | |
parent | 0380cafd806755da4e9c39508c8b9cd8a763caf0 (diff) |
First attempt at script to tweak squid for LAN usage.
-rwxr-xr-x | squid/squid.cf | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/squid/squid.cf b/squid/squid.cf new file mode 100755 index 0000000..2c30f36 --- /dev/null +++ b/squid/squid.cf @@ -0,0 +1,62 @@ +#! /usr/bin/cfengine -qf + +control: + OutputPrefix = ("${cf_prefix}") + actionsequence = ( editfiles ) + AddInstallable = ( squid_reload ) + EditfileSize = ( 150000 ) + +editfiles: + any:: + { /etc/squid/squid.conf + DefineClasses "squid_reload" + # + # maximum_object_size 64 MB + # + WarnIfNoLineMatching "^(# )?maximum_object_size[[:blank:]]" + BeginGroupIfNoLineMatching "^(# )?maximum_object_size" + Append "maximum_object_size 64 MB # Added by CFengine $(date)" + EndGroup + LocateLineMatching "^(# )?maximum_object_size" + BeginGroupIfNoLineMatching "^[[:blank:]]*maximum_object_size[[:blank:]]+64 MB[[:blank:]]*(#.*)$" + ReplaceLineWith "maximum_object_size 64 MB # Tweaked by CFengine $(date)" + EndGroup + # + # cache_dir ufs /var/spool/squid 1000 16 256 + # + ResetSearch "1" + WarnIfNoLineMatching "^(# )?cache_dir[[:blank:]]" + BeginGroupIfNoLineMatching "^(# )?cache_dir[[:blank:]]" + Append "cache_dir ufs /var/spool/squid 1000 16 256 # Added by CFengine $(date)" + EndGroup + LocateLineMatching "^(# )?cache_dir[[:blank:]]" + BeginGroupIfNoLineMatching "^[[:blank:]]*cache_dir[[:blank:]]+ufs /var/spool/squid 1000 16 256[[:blank:]]*(#.*)$" + ReplaceLineWith "cache_dir ufs /var/spool/squid 1000 16 256 # Tweaked by CFengine $(date)" + EndGroup + # + # acl our_networks src 80.208.177.0/24 192.168.101.0/24 192.168.102.0/24 192.168.103.0/24 + # http_access allow our_networks + # + ResetSearch "1" + WarnIfNoLineMatching "^(# )?acl[[:blank:]]+our_networks[[:blank:]]+src[[:blank:]]" + BeginGroupIfNoLineMatching "^(# )?acl[[:blank:]]+our_networks[[:blank:]]+src[[:blank:]]" + Append "acl our_networks src 80.208.177.0/24 192.168.101.0/24 192.168.102.0/24 192.168.103.0/24 # Added by CFengine $(date)" + EndGroup + LocateLineMatching "^(# )?acl[[:blank:]]+our_networks[[:blank:]]+src[[:blank:]]" + BeginGroupIfNoLineMatching "^[[:blank:]]*acl[[:blank:]]+our_networks[[:blank:]]+src[[:blank:]]80.208.177.0/24 192.168.101.0/24 192.168.102.0/24 192.168.103.0/24[[:blank:]]*(#.*)$" + ReplaceLineWith "acl our_networks src 80.208.177.0/24 192.168.101.0/24 192.168.102.0/24 192.168.103.0/24 # Tweaked by CFengine $(date)" + EndGroup + WarnIfNoLineMatching "^(# )?http_access[[:blank:]]+allow[[:blank:]]+our_networks[[:blank:]]*(#.*)?$" + BeginGroupIfNoLineMatching "^(# )?http_access[[:blank:]]+allow[[:blank:]]+our_networks[[:blank:]]*(#.*)?$" + Append "http_access allow our_networks # Added by CFengine $(date)" + EndGroup + LocateLineMatching "^(# )?http_access[[:blank:]]+allow[[:blank:]]+our_networks[[:blank:]]*(#.*)?$" + BeginGroupIfNoLineMatching "^http_access[[:blank:]]+allow[[:blank:]]+our_networks[[:blank:]]*(#.*)?$" + ReplaceLineWith "acl our_networks src 192.168.0.0/16 # Tweaked by CFengine $(date)" + EndGroup + } +processes: + "squid" restart "/etc/init.d/squid restart" +shellcommands: + squid_reload:: + "/etc/init.d/squid force-reload" |