0b7e2a679967166b5d7a542e1c80813ed5e50d65
[wyse_ntpd.git] / src / buildroot-2013.05 / custom / filesystem / etc / init.d / S99final_sequence
1 #!/bin/sh
2
3 if [ -f /fs/config/system ]
4 then
5         . /fs/config/system
6 else
7         mkdir -p /fs/config/
8 fi
9
10 if [ ! -f /fs/config/dropbear.tar ]
11 then
12         RD=`pwd`
13         cd /
14         tar cf /fs/config/dropbear.tar /etc/dropbear
15         cd $RD
16 fi
17
18 if [ -f /fs/config/ntp.conf ]
19 then
20         setserial /dev/ttyS0 low_latency
21         ntpd -c /fs/config/ntp.conf -x -g -N
22 fi
23
24 if [ -d /var/www/data ]
25 then
26
27         mknod /var/www/data/reboot p
28         chmod 644 /var/www/data/reboot
29         (echo "Rebooting..." > /var/www/data/reboot; reboot)&
30
31         cldate=`date '+%d.%m.%Y'`
32         touch /var/www/data/ntp.log.$cldate
33         chmod 644 /var/www/data/ntp.log.$cldate
34
35         (sleep 30; while(true); do date '+%s' >> /var/www/data/ntp.log.$cldate; ntpq -c lpe -n |grep "127.127.20" >> /var/www/data/ntp.log.$cldate; sleep 30; done) &
36 fi