mirror of
https://github.com/openwrt/packages.git
synced 2025-12-24 08:28:20 +04:00
ddns-scripts: get l3 device for bind network using curl
If pppoe is used for wan access. script set 'eth1' as interface for curl call. The correct interface is however 'pppoe-wan'. These scripts use 'network_get_physdev' function to get real device for bind_network but this is wrong. We need instead the l3_device of the the logical interface. In case if we don't use pppoe connection - 'l3_device' is equal to real device. Follow P/R: #14431 Signed-off-by: Coia Prant <coiaprant@gmail.com>
This commit is contained in:
committed by
Florian Eckert
parent
a36979c694
commit
9cd00fb191
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=ddns-scripts
|
PKG_NAME:=ddns-scripts
|
||||||
PKG_VERSION:=2.8.2
|
PKG_VERSION:=2.8.2
|
||||||
PKG_RELEASE:=58
|
PKG_RELEASE:=59
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
|
|
||||||
|
|||||||
@@ -96,8 +96,8 @@ __PRGBASE="$CURL -RsS -o $DATFILE --stderr $ERRFILE"
|
|||||||
# force network/interface-device to use for communication
|
# force network/interface-device to use for communication
|
||||||
if [ -n "$bind_network" ]; then
|
if [ -n "$bind_network" ]; then
|
||||||
local __DEVICE
|
local __DEVICE
|
||||||
network_get_physdev __DEVICE $bind_network || \
|
network_get_device __DEVICE $bind_network || \
|
||||||
write_log 13 "Can not detect local device using 'network_get_physdev $bind_network' - Error: '$?'"
|
write_log 13 "Can not detect local device using 'network_get_device $bind_network' - Error: '$?'"
|
||||||
write_log 7 "Force communication via device '$__DEVICE'"
|
write_log 7 "Force communication via device '$__DEVICE'"
|
||||||
__PRGBASE="$__PRGBASE --interface $__DEVICE"
|
__PRGBASE="$__PRGBASE --interface $__DEVICE"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ build_command() {
|
|||||||
# bind host/IP
|
# bind host/IP
|
||||||
if [ -n "$bind_network" ]; then
|
if [ -n "$bind_network" ]; then
|
||||||
local __DEVICE
|
local __DEVICE
|
||||||
network_get_physdev __DEVICE $bind_network || write_log 13 "Can not detect local device using 'network_get_physdev $bind_network' - Error: '$?'"
|
network_get_device __DEVICE $bind_network || write_log 13 "Can not detect local device using 'network_get_device $bind_network' - Error: '$?'"
|
||||||
write_log 7 "Force communication via device '$__DEVICE'"
|
write_log 7 "Force communication via device '$__DEVICE'"
|
||||||
__CMDBASE="$__CMDBASE --interface $__DEVICE"
|
__CMDBASE="$__CMDBASE --interface $__DEVICE"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -120,8 +120,8 @@ tencentcloud_transfer() {
|
|||||||
# force network/interface-device to use for communication
|
# force network/interface-device to use for communication
|
||||||
if [ -n "$bind_network" ]; then
|
if [ -n "$bind_network" ]; then
|
||||||
local __DEVICE
|
local __DEVICE
|
||||||
network_get_physdev __DEVICE $bind_network ||
|
network_get_device __DEVICE $bind_network ||
|
||||||
write_log 13 "Can not detect local device using 'network_get_physdev $bind_network' - Error: '$?'"
|
write_log 13 "Can not detect local device using 'network_get_device $bind_network' - Error: '$?'"
|
||||||
write_log 7 "Force communication via device '$__DEVICE'"
|
write_log 7 "Force communication via device '$__DEVICE'"
|
||||||
__PRGBASE="$__PRGBASE --interface $__DEVICE"
|
__PRGBASE="$__PRGBASE --interface $__DEVICE"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -93,8 +93,8 @@ __PRGBASE="$CURL -RsS -w '%{http_code}' -o $DATFILE --stderr $ERRFILE"
|
|||||||
# force network/interface-device to use for communication
|
# force network/interface-device to use for communication
|
||||||
if [ -n "$bind_network" ]; then
|
if [ -n "$bind_network" ]; then
|
||||||
local __DEVICE
|
local __DEVICE
|
||||||
network_get_physdev __DEVICE $bind_network || \
|
network_get_device __DEVICE $bind_network || \
|
||||||
write_log 13 "Can not detect local device using 'network_get_physdev $bind_network' - Error: '$?'"
|
write_log 13 "Can not detect local device using 'network_get_device $bind_network' - Error: '$?'"
|
||||||
write_log 7 "Force communication via device '$__DEVICE'"
|
write_log 7 "Force communication via device '$__DEVICE'"
|
||||||
__PRGBASE="$__PRGBASE --interface $__DEVICE"
|
__PRGBASE="$__PRGBASE --interface $__DEVICE"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ __PRGBASE="$CURL -RsS -w '%{http_code}' -o $DATFILE --stderr $ERRFILE"
|
|||||||
# force network/interface-device to use for communication
|
# force network/interface-device to use for communication
|
||||||
if [ -n "$bind_network" ]; then
|
if [ -n "$bind_network" ]; then
|
||||||
local __DEVICE
|
local __DEVICE
|
||||||
network_get_physdev __DEVICE $bind_network || \
|
network_get_device __DEVICE $bind_network || \
|
||||||
write_log 13 "Can not detect local device using 'network_get_physdev $bind_network' - Error: '$?'"
|
write_log 13 "Can not detect local device using 'network_get_device $bind_network' - Error: '$?'"
|
||||||
write_log 7 "Force communication via device '$__DEVICE'"
|
write_log 7 "Force communication via device '$__DEVICE'"
|
||||||
__PRGBASE="$__PRGBASE --interface $__DEVICE"
|
__PRGBASE="$__PRGBASE --interface $__DEVICE"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user