1 | #!/bin/bash -x |
---|
2 | svcstop /service/squid || exit 1 |
---|
3 | |
---|
4 | #standaard instellingen omzetten naar nieuwe systeem als dit eventueel moet. |
---|
5 | #needs conversion to new configfile. if this is found, always old configfile is present! |
---|
6 | |
---|
7 | #oude cache zooi opschonen, wordt ook niet meer aangemaakt |
---|
8 | if [ -f /var/log/squid/cache.log ]; then |
---|
9 | rm /var/log/squid/cache*; |
---|
10 | fi |
---|
11 | if [ -f /var/log/squid/store.log ]; then |
---|
12 | rm /var/log/squid/store* |
---|
13 | fi |
---|
14 | |
---|
15 | #'Multiple filterlist per regel systeem' converter. |
---|
16 | sed -i /home/system/proxy/squid.conf \ |
---|
17 | -e "s/acl manager proto cache_object/acl syn3ReqPro_Management_protocol proto \"\/home\/system\/proxy\/filterlists\/ReqPro_Management_protocol\"/1" \ |
---|
18 | -e "s/acl CONNECT method CONNECT/acl syn3ReqHead_CONNECT method \"\/home\/system\/proxy\/filterlists\/ReqHead_CONNECT\"/1" \ |
---|
19 | -e "s/http_access deny manager/http_access deny syn3ReqPro_Management_protocol/1" \ |
---|
20 | -e "s/http_access deny CONNECT \!syn3PortList_SSL_Ports/http_access deny \!syn3PortList_SSL_Ports syn3ReqHead_CONNECT/1" |
---|
21 | |
---|
22 | if ! (( `grep "auth_param ntlm" /home/system/proxy/squid.conf | wc -l` > 0 )); then |
---|
23 | sed -i /home/system/proxy/squid.conf \ |
---|
24 | -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/' |
---|
25 | fi |
---|
26 | |
---|
27 | |
---|
28 | if ! (( `grep "external_acl_type wbinfo_group" /home/system/proxy/squid.conf | wc -l` > 0 )); then |
---|
29 | sed -i /home/system/proxy/squid.conf \ |
---|
30 | -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/' |
---|
31 | fi |
---|
32 | |
---|
33 | #Needed for x-forward-for headers: |
---|
34 | if ! grep follow_x_forwarded_for /home/system/proxy/squid.conf; then |
---|
35 | echo follow_x_forwarded_for allow syn3SourceList_localhost >> /home/system/proxy/squid.conf |
---|
36 | fi |
---|
37 | |
---|
38 | squid -z || exit 1 |
---|
39 | svcreset /service/squid || exit 1 |
---|