Changeset 20810


Ignore:
Timestamp:
2010-04-11T22:43:41+02:00 (7 years ago)
Author:
florian
Message:

[package] allow a script to get the ip address, patch from Tomasz Fornal

Location:
packages/net/ddns-scripts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • packages/net/ddns-scripts/Makefile

    r19009 r20810  
    33PKG_NAME:=ddns-scripts 
    44PKG_VERSION:=1.0.0 
    5 PKG_RELEASE:=6 
     5PKG_RELEASE:=7 
    66 
    77PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) 
  • packages/net/ddns-scripts/files/etc/config/ddns

    r10705 r20810  
    3131# (e.g. "eth1") and whatever the current ip of this interface is 
    3232# will be associated with the domain when an update is performed. 
     33# 
     34# If "ip_source" is "script" you specify a script to obtain ip address. 
     35# The "ip_script" option should contain path to your script. 
    3336# 
    3437# The last possibility is that "ip_source" is "web", which means 
     
    7881        #option ip_interface    "eth0.1" 
    7982 
     83        #option ip_source       "script" 
     84        #option ip_script       "path to your scrip" 
     85 
    8086        #option ip_source       "web" 
    8187        #option ip_url          "http://www.whatismyip.com/automation/n09230945.asp" 
  • packages/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh

    r10705 r20810  
    5454 
    5555        #if ip source is not defined, assume we want to get ip from wan  
    56         if [ "$ip_source" != "interface" ] && [ "$ip_source" != "web" ] 
     56        if [ "$ip_source" != "interface" ] && [ "$ip_source" != "web" ] && [ "$ip_source" != "script" ] 
    5757        then 
    5858                ip_source="network" 
     
    7575        then 
    7676                current_ip=$(ifconfig $ip_interface | grep -o 'inet addr:[0-9.]*' | grep -o "$ip_regex") 
     77        elif [ "$ip_source" = "script" ] 
     78        then 
     79                # get ip from script 
     80                current_ip=$($ip_script) 
    7781        else 
    7882                # get ip from web 
Note: See TracChangeset for help on using the changeset viewer.