auto-disable-wifi/auto-disable-wifi.sh
2022-03-16 18:22:50 +01:00

16 lines
258 B
Bash

#!/usr/bin/env bash
wired_interfaces="en.*|eth.*"
if [[ "$1" =~ $wired_interfaces ]]; then
case "$2" in
up)
#nmcli radio wifi off
rfkill block wifi
;;
down)
#nmcli radio wifi on
rfkill unblock wifi
;;
esac
fi