#! /bin/sh
#
# cron script to rotate xntpd log file.
#

case $(start-stop-daemon --test --stop --exec /usr/sbin/xntpd) in
    *would\ send\ signal*)

	/etc/init.d/xntp stop

	if [ -f /var/log/xntpd ]; then
		savelog -g adm -m 644 -u root -c 4 /var/log/xntpd > /dev/null
	fi

	if [ -d /var/log/ntpstats ]; then
		find /var/log/ntpstats -type f -mtime +7 -exec rm {} \;
	fi

	/etc/init.d/xntp start > /dev/null

    ;;
esac
