Paws/ShellScripts/set_dns_search_domain.sh

11 lines
373 B
Bash
Raw Normal View History

#!/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