]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/paks/squidclamav/update.sh
media.cgi: Fix typo 'writen'.
[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
cfab012b 31 restore_backup ${NAME}
f18be3b0
CS
32fi
33
34if [ "$VERSION" -lt "11" ]; then
cfab012b 35 sed -e "s|logfile.*|logfile /var/log/squid/squidclamav.log|g" /etc/squidclamav.conf
f18be3b0
CS
36fi
37
f7a617a0 38if [ "$VERSION" -lt "16" ]; then
cfab012b
MT
39 sed -i /etc/squidclamav.conf \
40 -e "s/proxy none//g" \
41 -e "s/^#squid_ip 127\.0\.0\.1/squid_ip 127\.0\.0\.1/g" \
42 -e "s/^#squid_port 3128/squid_port 800/g" \
43 -e "s/^#trust_cache 1/trust_cache 1/g"
f7a617a0 44
cfab012b
MT
45 # Fix permissions.
46 chmod 664 /etc/squidclamav.conf
47 chown root.nobody /etc/squidclamav.conf
25848b36 48
cfab012b
MT
49 # Regenerate configuration files.
50 perl /srv/web/ipfire/cgi-bin/proxy.cgi
f7a617a0
SS
51fi
52
9fa764c6 53/etc/init.d/squid restart