Skip to content

Instantly share code, notes, and snippets.

@larsbratholm
Created September 24, 2016 15:00
Show Gist options
  • Save larsbratholm/7ab3f31b1dac916c13d23bc5fc4c8ba5 to your computer and use it in GitHub Desktop.
Save larsbratholm/7ab3f31b1dac916c13d23bc5fc4c8ba5 to your computer and use it in GitHub Desktop.
Enable/disable flightmode
#!/usr/bin/env bash
if [ "${1,,}" = "on" ] || [ "${1,,}" = "enable" ] || [ "${1,,}" = "1" ]; then
arg=0
elif [ "${1,,}" = "off" ] || [ "${1,,}" = "disable" ] || [ "${1,,}" = "0" ]; then
arg=1
else echo "Unknown argument: $1"; exit 1
fi
nmcli r all $arg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment