]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/paks/squidclamav/update.sh
squidclamav: Fix permissions of /etc/squidclamav.conf.
[people/teissler/ipfire-2.x.git] / src / paks / squidclamav / update.sh
CommitLineData
bf660619
CS
1#!/bin/bash
2############################################################################
3# #
4# This file is part of the IPFire Firewall. #
5# #
6# IPFire is free software; you can redistribute it and/or modify #
7# it under the terms of the GNU General Public License as published by #
8# the Free Software Foundation; either version 2 of the License, or #
9# (at your option) any later version. #
10# #
11# IPFire is distributed in the hope that it will be useful, #
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
17# along with IPFire; if not, write to the Free Software #
18# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
19# #
9fa764c6 20# Copyright (C) 2010 IPFire-Team <info@ipfire.org>. #
bf660619
CS
21# #
22############################################################################
23#
24. /opt/pakfire/lib/functions.sh
25./uninstall.sh
9fa764c6 26extract_files
f18be3b0
CS
27
28VERSION=$(cat /opt/pakfire/db/installed/meta-squidclamav | grep Release | cut -d" " -f2)
29
30if [ "$VERSION" -gt "10" ]; then
31 restore_backup ${NAME}
32fi
33
34if [ "$VERSION" -lt "11" ]; then
35 sed -e "s|logfile.*|logfile /var/log/squid/squidclamav.log|g" /etc/squidclamav.conf
36fi
37
f7a617a0
SS
38if [ "$VERSION" -lt "16" ]; then
39 sed -e "s/proxy none//g" -i /etc/squidclamav.conf
40 sed -e "s/^#squid_ip 127\.0\.0\.1/squid_ip 127\.0\.0\.1/g" \
41 -e "s/^#squid_port 3128/squid_port 800/g" \
42 -e "s/^#trust_cache 1/trust_cache 1/g" -i /etc/squidclamav.conf
43
25848b36
MT
44 # Fix permissions.
45 chmod 664 /etc/squidclamav.conf
46 chown root.nobody /etc/squidclamav.conf
47
f7a617a0
SS
48 # Regenerate configuration files.
49 perl /srv/web/ipfire/cgi-bin/proxy.cgi
50fi
51
9fa764c6 52/etc/init.d/squid restart