mirror of
https://github.com/openwrt/packages.git
synced 2026-12-04 06:55:44 +04:00
ddns-scripts: fix debug log for interface IP
The debug log printed when detecting the IP address from an interface did not include the IP family option, while the commands actually executed use `-4` or `-6` depending on `use_ipv6`. Include the family option in the log so that it matches the command that is run. Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
This commit is contained in:
1 parent
c4b1663927
commit
52e2e9bd97
1 file changed
+1
-1
@@ -881,7 +881,7 @@ get_current_ip () {
|
||||
[ -z "$ip_interface" ] && { write_log 12 "get_current_ip: 'ip_interface' not set for source 'interface'"; return 2; }
|
||||
# Test for alias interfaces e.g. "@wan6"; get the effective layer 3 interface
|
||||
[ "${ip_interface#*'@'}" != "$ip_interface" ] && network_get_device ip_interface "$ip_interface"
|
||||
write_log 7 "#> ip -o -br -js addr show dev '$ip_interface' scope global | $jsonfilter -e '@[0].addr_info[0].local'"
|
||||
write_log 7 "#> ip -o -$((use_ipv6 ? 6 : 4)) -br -js addr show dev '$ip_interface' scope global | $jsonfilter -e '@[0].addr_info[0].local'"
|
||||
[ "$use_ipv6" -eq 0 ] && data=$(ip -o -4 -br -js addr show dev "$ip_interface" scope global | "$jsonfilter" -e '@[0].addr_info[0].local')
|
||||
[ "$use_ipv6" -eq 1 ] && data=$(ip -o -6 -br -js addr show dev "$ip_interface" scope global | "$jsonfilter" -e '@[0].addr_info[0].local')
|
||||
[ -n "$data" ] && write_log 7 "Current IP '$data' detected on interface '$ip_interface'"
|
||||
|
||||
Reference in new issue
Block a user