updatedd:
* Update the init script and config file to use multiple updates * Cleanup the Makefile git-svn-id: svn://svn.openwrt.org/openwrt/packages@8072 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@ -1,6 +0,0 @@
|
||||
config updatedd
|
||||
option ddns_service ''
|
||||
option ddns_user ''
|
||||
option ddns_passwd ''
|
||||
option ddns_host ''
|
||||
option ddns_update '0'
|
@ -1,27 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
START=50
|
||||
|
||||
. /etc/functions.sh
|
||||
|
||||
config_load updatedd
|
||||
config_get ddns_service cfg1 ddns_service
|
||||
config_get ddns_user cfg1 ddns_user
|
||||
config_get ddns_passwd cfg1 ddns_passwd
|
||||
config_get ddns_host cfg1 ddns_host
|
||||
config_get ddns_update cfg1 ddns_update
|
||||
|
||||
start() {
|
||||
[ "$ddns_update" = 1 ] && {
|
||||
/usr/bin/updatedd -Y $ddns_service -- $ddns_user:$ddns_passwd $ddns_host
|
||||
}
|
||||
}
|
||||
|
||||
stop() {
|
||||
killall updatedd
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
6
net/updatedd/files/updatedd.config
Normal file
6
net/updatedd/files/updatedd.config
Normal file
@ -0,0 +1,6 @@
|
||||
config updatedd
|
||||
option service ''
|
||||
option user ''
|
||||
option passwd ''
|
||||
option host ''
|
||||
option update '0'
|
@ -9,7 +9,7 @@ COMMAND=/usr/bin/$NAME
|
||||
|
||||
config_get ifname wan ifname
|
||||
[ -n "$ifname" ] && {
|
||||
/etc/init.d/ddns restart
|
||||
/etc/init.d/updatedd restart
|
||||
}
|
||||
} &
|
||||
}
|
30
net/updatedd/files/updatedd.init
Normal file
30
net/updatedd/files/updatedd.init
Normal file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
START=50
|
||||
|
||||
start_service () {
|
||||
local section="$1"
|
||||
config_get service "$section" service
|
||||
config_get user "$section" user
|
||||
config_get passwd "$section" passwd
|
||||
config_get host "$section" host
|
||||
config_get update "$section" update
|
||||
|
||||
[ "$update" = 1 ] && {
|
||||
/usr/bin/updatedd -Y $service -- $user:$passwd $host
|
||||
}
|
||||
}
|
||||
|
||||
start() {
|
||||
config_load "updatedd"
|
||||
config_foreach start_service updatedd
|
||||
}
|
||||
|
||||
stop() {
|
||||
killall updatedd
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
Reference in New Issue
Block a user