13 lines
243 B
Text
13 lines
243 B
Text
|
#!/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)
|