void-packages/srcpkgs/ntp/files/ntpd.cron-hourly

13 lines
243 B
Text
Raw Normal View History

#!/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)