c37352b255e9c97c59167d306baade5c6fa98c93
[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 mkdir /var/www/data/stats
11 chmod 777 /var/www/data/stats
12 mkdir /var/www/data/logs
13 chmod 777 /var/www/data/logs
14
15 if [ ! -f /fs/config/dropbear.tar ]
16 then
17         RD=`pwd`
18         cd /
19         tar cf /fs/config/dropbear.tar /etc/dropbear
20         cd $RD
21 fi
22
23 if [ -f /fs/config/ntp.conf ]
24 then
25         setserial /dev/ttyS0 low_latency
26         ntpd -c /fs/config/ntp.conf -x -g -N
27 fi
28
29 if [ -d /var/www/data ]
30 then
31         /opt/reboot_daemon.sh > /var/www/data/logs/reboot_daemon 2>&1 &
32         /opt/restart_ssh_daemon.sh > /var/www/data/logs/restart_ssh_daemon 2>&1 &
33         /opt/stats_daemon.sh > /var/www/data/logs/stats_daemon 2>&1 &
34 fi
35
36
37 if [ -f /fs/config/inetd.conf ]
38 then
39         /usr/sbin/inetd /fs/config/inetd.conf
40         /usr/sbin/inetd
41 else 
42         # this is a little silly, i should really be a little more useful with this
43 cat > /fs/config/inetd.conf << EOF
44 10011 stream tcp nowait root sh
45 10010 stream tcp nowait root reboot
46 EOF
47         /usr/sbin/inetd
48
49 fi