core: 防止将多份 ra 设置为变量

This commit is contained in:
bin456789 2023-09-03 19:35:03 +08:00
parent 6cf2793d30
commit 54f519cf69
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -229,7 +229,8 @@ is_virt() {
get_ra_to() { get_ra_to() {
if [ -z "$_ra" ]; then if [ -z "$_ra" ]; then
apk add ndisc6 apk add ndisc6
_ra="$(rdisc6 eth0)" # 有时会重复收取,所以设置收一份后退出
_ra="$(rdisc6 -1 eth0)"
apk del ndisc6 apk del ndisc6
fi fi
eval "$1='$_ra'" eval "$1='$_ra'"