📅  最后修改于: 2022-03-11 14:51:08.850000             🧑  作者: Mango
function set_nextdns_for_vpn {
vpn_id=`nmcli con show --active | grep -i vpn | grep -v 'dummy' | awk '{print $3}'`
if [ ! -z "$vpn_id" ]
then
nmcli connection modify "$vpn_id" ipv4.ignore-auto-dns true
nmcli connection modify "$vpn_id" ipv4.dns 45.90.28.28,45.90.30.28
fi
}