#!/bin/bash -x svcstop /service/squid || exit 1 #standaard instellingen omzetten naar nieuwe systeem als dit eventueel moet. #needs conversion to new configfile. if this is found, always old configfile is present! #oude cache zooi opschonen, wordt ook niet meer aangemaakt if [ -f /var/log/squid/cache.log ]; then rm /var/log/squid/cache*; fi if [ -f /var/log/squid/store.log ]; then rm /var/log/squid/store* fi #'Multiple filterlist per regel systeem' converter. sed -i /home/system/proxy/squid.conf \ -e "s/acl manager proto cache_object/acl syn3ReqPro_Management_protocol proto \"\/home\/system\/proxy\/filterlists\/ReqPro_Management_protocol\"/1" \ -e "s/acl CONNECT method CONNECT/acl syn3ReqHead_CONNECT method \"\/home\/system\/proxy\/filterlists\/ReqHead_CONNECT\"/1" \ -e "s/http_access deny manager/http_access deny syn3ReqPro_Management_protocol/1" \ -e "s/http_access deny CONNECT \!syn3PortList_SSL_Ports/http_access deny \!syn3PortList_SSL_Ports syn3ReqHead_CONNECT/1" if ! (( `grep "auth_param ntlm" /home/system/proxy/squid.conf | wc -l` > 0 )); then sed -i /home/system/proxy/squid.conf \ -e 's/# TAG: auth_param/# TAG: auth_param\n#auth_param ntlm program \/usr\/bin\/ntlm_auth --helper-protocol=squid-2.5-ntlmssp\n#auth_param ntlm children 5/' fi if ! (( `grep "external_acl_type wbinfo_group" /home/system/proxy/squid.conf | wc -l` > 0 )); then sed -i /home/system/proxy/squid.conf \ -e 's/external_acl_type ldap_group ttl=300 %LOGIN \/usr\/bin\/squid_ldap_group -b "ou=Groups,dc=syn-3" -h ldap-master -f "(\&(memberuid=%v)(cn=%a))"/external_acl_type ldap_group ttl=300 %LOGIN \/usr\/bin\/squid_ldap_group -b "ou=Groups,dc=syn-3" -h ldap-master -f "(\&(memberuid=%v)(cn=%a))" \nexternal_acl_type wbinfo_group %LOGIN \/usr\/bin\/wbinfo_group.pl/' fi #Needed for x-forward-for headers: if ! grep follow_x_forwarded_for /home/system/proxy/squid.conf; then echo follow_x_forwarded_for allow syn3SourceList_localhost >> /home/system/proxy/squid.conf fi squid -z || exit 1 svcreset /service/squid || exit 1