Revert "chore: update resource"

This reverts commit e3c52781f3.
This commit is contained in:
huzibaca
2024-10-27 05:10:26 +08:00
parent 5ef9220175
commit df3c296850
4 changed files with 3 additions and 12 deletions

22
scripts/unset_dns.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
nic=$(route -n get default | grep "interface" | awk '{print $2}')
hardware_port=$(networksetup -listallhardwareports | awk -v dev="$nic" '
/Hardware Port:/{
port=$0; gsub("Hardware Port: ", "", port)
}
/Device: /{
if ($2 == dev) {
print port;
exit
}
}
')
if [ -f original_dns.txt ]; then
original_dns=$(cat original_dns.txt)
else
original_dns=$(networksetup -getdnsservers "$hardware_port")
fi
networksetup -setdnsservers "$hardware_port" $original_dns