#!/bin/sh -e
#
# Test if kde applications are properly configured

if test -r /etc/debian-edu/config ; then
    . /etc/debian-edu/config
fi

# Check /etc/kde[23]/kioslaverc, it should be readable by all, and
# contain references to the web cache.

for file in /etc/kde2/kioslaverc /etc/kde3/kioslaverc ; do
    if [ -f $file ] ; then
	mode="`stat -c "%a" $file`"
	if [ 644 = "$mode" ] || [ 755 = "$mode" ]; then
	    echo "success: $0: Correct permissions for $file"
	else
	    echo "error: $0: Incorrect permissions for $file"
	    ls -l $file
	fi
	if grep -q webcache:3128 $file ; then
	    echo "success: $0: Proxy settings in $file"
	else
	    echo "error: $0: Missing proxy settings in $file"
	fi
    fi
done

exit 0
