Paws/ShellScripts/set_dns_search_domain.sh
Aroy-Art 6926af6485
All checks were successful
/ test (push) Successful in 19s
Add: script for auto testing resolve domain to specific interface
2024-03-11 23:01:49 +01:00

10 lines
373 B
Bash
Executable file

#!/bin/bash
# Check the SSID of the connected Wi-Fi network
current_ssid=$(nmcli -t -f active,ssid dev wifi | grep -E '^yes' | cut -d\: -f2)
# Check if the connected Wi-Fi network is the one you want to target
if [ "$current_ssid" = "<Your_Targeted_WiFi_SSID>" ]; then
# Set the DNS search domain for the taget interface
resolvectl domain <interface> <domain>
fi