#! /bin/sh
# db update script for Chastity
#

echo -n "Double checking directory and file permissions..."
chown -R proxy.proxy /var/lib/chastity >/dev/null 2>&1
chmod 2770 /var/lib/chastity >/dev/null 2>&1
echo "done!"
echo -n "Re-building Chastity SquidGuard db files..."
su - proxy -c "squidGuard -C all -c /etc/chastity/squidGuard-chastity.conf" >/dev/null 2>&1
su - proxy -c "squidGuard -u -c /etc/chastity/squidGuard-chastity.conf" >/dev/null 2>&1
echo "done!"

if [ -e /etc/init.d/squid ]; then
echo -n "Reloading Squid..."
/etc/init.d/squid reload >/dev/null 2>&1
echo "done!"
fi

