Skip to content

Instantly share code, notes, and snippets.

@mdaffin
Last active December 3, 2021 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mdaffin/96e4543111ac8335167e3c43caeb91cd to your computer and use it in GitHub Desktop.
Save mdaffin/96e4543111ac8335167e3c43caeb91cd to your computer and use it in GitHub Desktop.
A script to make connecting with wpa_cli easier (Work in progress)
#!/bin/bash
# Wraps aursync command to mount an amazon s3 bucket which contains a repository
set -uo pipefail
trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
INTERFACE=wlp58s0
wpa() {
wpa_cli -i "${INTERFACE}" "$@"
}
case "$1" in
list)
wpa scan_results | cut -f 5- | grep -v '^$'
;;
add)
network=$(add_network)
wpa set_network "${network}" ssid '"GBK WIFI"'
wpa set_network "${network}" key_mgmt NONE
wpa enable_network "${network}"
wpa save_config
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment