#!/bin/sh cat /etc/asterisk/ntp.conf |grep =|tr -d " " > /tmp/ntp.conf.tmp . /tmp/ntp.conf.tmp #killall ntpd /etc/init.d/ntp stop > /dev/null TZ=$TZNAME if ntpdate $NTPserver 1> /dev/null ;then echo "Sync success!" /etc/init.d/hwclock.sh stop else echo "Sync failed!" fi echo `date "+%x %R"` /etc/init.d/ntp start > /dev/null