# HG changeset patch # User Eric Joseph-Alexandre # Date 1330556477 -3600 # Node ID be8fcea4e231ad2bc2203aae099f6fddca058c6d # Parent b2aa205abf59703b9bbeb12c919de833a49896f9 squidguard: improve package diff -r b2aa205abf59 -r be8fcea4e231 squidguard/receipt --- a/squidguard/receipt Thu Mar 01 00:00:54 2012 +0100 +++ b/squidguard/receipt Thu Mar 01 00:01:17 2012 +0100 @@ -46,30 +46,26 @@ # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { - cp -a $_pkg/* $fs/ + mkdir -p $fs/etc/squid/conf.d + + cp -a $install/* $fs/ + cp -pa $stuff/squidguard.conf $fs/etc/squid/conf.d + + # Cleanup. rmdir $fs/usr/squidGuard + } # Pre and post install commands for Tazpkg. post_install() { chown -R nobody $1/var/lib/squidGuard/* - if ! grep -q ^redirect_program $1/etc/squid/squid.conf ; then - echo "Updating /etc/squid/squid.conf" - cat >> $1/etc/squid/squid.conf < /dev/null - fi + # Recharge squid config + [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null } post_remove() { - if grep -q "squidGuard" /etc/squid/squid.conf ; then - echo "Updating /etc/squid/squid.conf" - sed -i -e "s/.*squidGuard.*//" /etc/squid/squid.conf - # Restart squid if running - $(which squid) -k reconfigure 2> /dev/null - fi + # Recharge squid config + [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null } diff -r b2aa205abf59 -r be8fcea4e231 squidguard/stuff/squidguard.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/squidguard/stuff/squidguard.conf Thu Mar 01 00:01:17 2012 +0100 @@ -0,0 +1,2 @@ +# Enable SquidGuard URL filter +redirect_program /usr/bin/squidGuard -c /etc/squidGuard/squidGuard.conf