Skip to content

用飞牛NAS时,解析IPV6地址遇到命令获取失败的情况~ #1377

Description

@worm001

Description

只能使用IPV6,动态域名是dynv6的,三种方式:第一种获取的地址不准确,第二种网卡获取的方式会因为重拨号导致变化,虽然可以指定@2 3 这类位置,但是重拨多次后始终只有最后一个地址是能用的,有没有正则表达表可以只获取最后一个IPV6地址? 第三种是用命令,在飞牛的SSH中可以正常获取的命令是: ip -6 a | awk -F '[ \t]+|/' '/inet6/ && $3 != "::1" && $3 !~ /^fe80::/ && $3 !~ /^fda8:/ {ipv6=$3; getline; if ($2=="valid_lft") {split($3, t, "sec"); if (t[1] > max) {max=t[1]; best=ipv6}}} END {print best}' 但是把这个命令填到里面保存后,会报错: 获取IPv6结果失败! 未能成功执行命令:sh -c ip -6 a | awk -F '[ \t]+|/' '/inet6/ && $3 != "::1" && $3 !~ /^fe80::/ && $3 !~ /^fda8:/ {ipv6=$3; getline; if ($2=="valid_lft") {split($3, t, "sec"); if (t[1] > max) {max=t[1]; best=ipv6}}} END {print best}', 错误:"", 退出状态码:exec: "sh": executable file not found in $PATH 这种情况可以如何解决?

Image

Image

DNS Provider

Callback

Did you search for similar issues before submitting this one?

Yes, I did, but I didn't find anything useful

Operating System

Linux

Architecture

x86_64

Version

6.8.1

How are you running ddns-go?

Other

Any other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions