Hello Guys, I have been trying to disable the Ethernet / LAN connection to our end users and only enable WIFI but my script seems to be not working well. Do you mind sharing your scripts or changes from your end?
Here's my script that i also found here.
#!/bin/bash
validConnections=("Ethernet" "Wi-Fi" "USB Ethernet"
"Broadcom NetXtreme Gigabit Ethernet Controller"
"Display Ethernet"
"Thunderbolt Bridge"
"Thunderbolt Ethernet")
while read connection; do
if [[ $(echo "${validConnections[@]}" | grep "$connection") ]]; then
setting=$(networksetup -getautoproxyurl "$connection" | awk '/Enabled/{print $NF}')
if [[ "$setting" == "No" ]]; then
Disabled+=("$connection")
elif [[ "$setting" == "Yes" ]]; then
Enabled+=("$connection")
fi
fi
done < <(networksetup -listallhardwareports | awk -F': ' '/Hardware Port:/{print $NF}')
if [[ -z "${Disabled[@]}" ]]; then
echo "<result>Yes</result>"
else
echo "<result>No</result>"
fi