Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# When connecting to this connection, DISABLE the device defined below
EXCLUSIVE_CONNECTION_UUID="00000000-0000-0000-0000-000000000000" #changeme
# This device will be disabled
DOWN_DEVICE=wlan0
if [ "$CONNECTION_UUID" = "$EXCLUSIVE_CONNECTION_UUID" ] && [ "$NM_DISPATCHER_ACTION" = "up" ]; then
/usr/bin/nmcli device set "$DOWN_DEVICE" managed no