openwrt获取ipv6的脚本

in 默认分类 with 0 comment
#!/bin/sh

ip addr show|grep -v deprecated|grep -A1 'inet6 [^f:]'|grep -v ^--|sed -nr ':a;N;s#^ +inet6 ([a-f0-9:]+)/.+? scope global .*? valid_lft ([0-9]+sec) .*#\2 \1#p;Ta'|grep 'ff:fe'|sort -nr|head -n1|cut -d' ' -f2

保存为任意文件
记得chmod +x [filename]

Responses