Changeset 19134


Ignore:
Timestamp:
2010-01-14T20:02:19+01:00 (8 years ago)
Author:
jow
Message:

[packages] ntpclient: add option to bind ntpclient to a specific interface (#6470)

Location:
packages/net/ntpclient
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • packages/net/ntpclient/Makefile

    r18478 r19134  
    11# 
    2 # Copyright (C) 2006-2009 OpenWrt.org 
     2# Copyright (C) 2006-2010 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    1010PKG_NAME:=ntpclient 
    1111PKG_VERSION:=2007_365 
    12 PKG_RELEASE:=3 
     12PKG_RELEASE:=4 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz 
  • packages/net/ntpclient/files/ntpclient.config

    r17750 r19134  
    2121        option interval 600 
    2222        #option count   10 
     23        #option interface wan 
  • packages/net/ntpclient/files/ntpclient.hotplug

    r18478 r19134  
    88unset INTERVAL 
    99unset COUNT 
     10unset INTERFACE_GLOBAL 
     11 
    1012NTPC=`which ntpclient` 
    1113 
     
    1315        local hostname 
    1416        local port 
     17        local interface 
    1518        [ -n "$SERVER" ] && return 
    1619        config_get hostname $1 hostname 
    1720        config_get port $1 port 
     21        config_get interface $1 interface 
     22 
     23        [ -z "$interface" ] && interface=$INTERFACE_GLOBAL 
     24 
     25        [ -n "$interface" ] && { 
     26                # $INTERFACE is passed from hotplug event 
     27                [ "$interface" = "$INTERFACE" ] || return 
     28        } 
     29 
    1830        [ -z "$hostname" ] && return 
    1931        $NTPC -c 1 -p ${port:-123} -i 2 -h $hostname > /dev/null && { SERVER=$hostname; PORT=${port:-123}; } 
     
    4557        config_get interval $1 interval 
    4658        config_get count $1 count 
     59        config_get interface $1 interface 
    4760         
    4861        [ -n "$count" ] && COUNT=$count 
    4962        [ -n "$interval" ] && INTERVAL=$interval 
     63        [ -n "$interface" ] && INTERFACE_GLOBAL=$interface 
    5064} 
    5165 
Note: See TracChangeset for help on using the changeset viewer.