Quantcast
Channel: Uncategorized – DO-RE-M(IT)
Viewing all articles
Browse latest Browse all 14

sync ntp cron script.

$
0
0

Just a little script to sync the localtime against a ntp server using cron.

#!/bin/bash
# Sync time next to ntp daemon
# Chris 5-2-1010
NTPD=`find /etc/init.d/ -name "ntpd"`;
echo $NTPD;
NTPDATE=`which ntpdate`;
if [ -f $NTPD ]; then
        STDOUT=`$NTPD stop`;
        if [ -f $NTPDATE ]; then
                STDOUT=`$NTPDATE 10.252.252.2`;
                STDOUT=`$NTPD start`;
        else
                STDOUT=`$NTPD start`;
        fi
else
        exit 1;
fi
exit 0;


Viewing all articles
Browse latest Browse all 14

Trending Articles