wok-4.x rev 11916

squidguard: improve package
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Thu Mar 01 00:01:17 2012 +0100 (2012-03-01)
parents b2aa205abf59
children 61855e8d38b8
files squidguard/receipt squidguard/stuff/squidguard.conf
line diff
     1.1 --- a/squidguard/receipt	Thu Mar 01 00:00:54 2012 +0100
     1.2 +++ b/squidguard/receipt	Thu Mar 01 00:01:17 2012 +0100
     1.3 @@ -46,30 +46,26 @@
     1.4  # Rules to gen a SliTaz package suitable for Tazpkg.
     1.5  genpkg_rules()
     1.6  {
     1.7 -	cp -a $_pkg/* $fs/
     1.8 +	mkdir -p $fs/etc/squid/conf.d
     1.9 +	
    1.10 +	cp -a $install/* $fs/
    1.11 +	cp -pa $stuff/squidguard.conf $fs/etc/squid/conf.d
    1.12 +	
    1.13 +	# Cleanup.
    1.14  	rmdir $fs/usr/squidGuard
    1.15 +	
    1.16  }
    1.17  
    1.18  # Pre and post install commands for Tazpkg.
    1.19  post_install()
    1.20  {
    1.21  	chown -R nobody $1/var/lib/squidGuard/*
    1.22 -	if ! grep -q ^redirect_program $1/etc/squid/squid.conf ; then
    1.23 -		echo "Updating /etc/squid/squid.conf"
    1.24 -		cat >> $1/etc/squid/squid.conf <<EOF
    1.25 -redirect_program /usr/bin/squidGuard -c /etc/squidGuard/squidGuard.conf
    1.26 -EOF
    1.27 -		# Restart squid if running
    1.28 -		$(which squid) -k reconfigure 2> /dev/null
    1.29 -	fi
    1.30 +	# Recharge squid config
    1.31 +	[ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null
    1.32  }
    1.33  
    1.34  post_remove()
    1.35  {
    1.36 -	if grep -q "squidGuard" 	/etc/squid/squid.conf ; then
    1.37 -		echo "Updating /etc/squid/squid.conf"
    1.38 -		sed -i -e "s/.*squidGuard.*//" /etc/squid/squid.conf
    1.39 -		# Restart squid if running
    1.40 -		$(which squid) -k reconfigure 2> /dev/null
    1.41 -	fi
    1.42 +	# Recharge squid config
    1.43 +	[ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null
    1.44  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/squidguard/stuff/squidguard.conf	Thu Mar 01 00:01:17 2012 +0100
     2.3 @@ -0,0 +1,2 @@
     2.4 +# Enable SquidGuard  URL filter
     2.5 +redirect_program /usr/bin/squidGuard -c /etc/squidGuard/squidGuard.conf