vp-build/templates/ntp/files/ntpd.cron-hourly
Juan RP bd95f01f41 ntp: fix deps, add cron script to restart ntpd if necessary.
Bump revision.

--HG--
extra : convert_revision : 60243522b1e09709725cf12e8a9d641f712b84b2
2009-10-04 15:03:32 +02:00

13 lines
243 B
Bash

#!/bin/sh
#
# Restarts ntpd if no connected peers are found.
#
ntpq_cmd=/usr/bin/ntpq
ntpd_initd=/etc/init.d/ntpd
if [ ! -x $ntpq_cmd -o ! -x $ntpd_initd ]; then
exit 0
fi
$ntpq_cmd -np | grep '^\*' >/dev/null || (/etc/init.d/ntpd restart)