English Language flag
// Log In
// CVSweb
Project: FreeWRT
// Summary // Activity // Search // Tracker // Lists // News // SCM // Wiki

SCM Repository

ViewVC logotype

Diff of /branches/freewrt_1_0/package/ntpclient/files/ntpclient.init

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2765 by wbx, Sat Mar 24 12:47:30 2007 UTC revision 2766 by tha, Mon Jun 11 23:24:02 2007 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/sh
2  case "${ACTION:-ifup}" in  
3          ifup)  . /etc/rc.conf
4                  ps x | grep 'bin/[n]tpclient' >&- || {  
5                          ip route show 2>&- | grep '^default' >&- && /usr/sbin/ntpclient -c 1 -s -h ${ntp_server:-pool.ntp.org} &  case $1 in
6                  }  autostart)
7                  ;;          test x"${ntpclient:-NO}" = x"NO" && exit 0
8          ifdown)          sleep 15
9                  ip route show 2>&- | grep '^default' >&- || killall ntpclient 2>&- >&- ;;          exec $0 start
10            ;;
11    start)
12            default_flags="-c 1 -s"
13            if [ -e /etc/ntpd.conf ]; then
14                    tmp=`cat /etc/ntpd.conf | grep ^server | awk '{ print $2 }' | head -n1`
15                    tmp="${tmp:-pool.ntp.org}"
16            fi
17            ntpclient_server="${ntpclient_server:-$tmp}"
18            ntpclient_flags="${ntpclient_flags:-$default_flags}"
19    
20            /usr/sbin/ntpclient $ntpclient_flags -h $ntpclient_server >/dev/null &
21            ;;
22    stop)
23            killall ntpclient
24            ;;
25    restart)
26            $0 stop
27            $0 start
28            ;;
29    *)
30            echo "Usage: $0 {start | stop | restart}"
31            exit 1
32            ;;
33  esac  esac
34    exit $?
35    

Legend:
Removed from v.2765  
changed lines
  Added in v.2766

root@freewrt.org:443
ViewVC Help
Powered by ViewVC 1.1.20