Skip to content

Instantly share code, notes, and snippets.

@gnue
Created July 11, 2017 03:13
Show Gist options
  • Save gnue/ed5250ff83a731a4f0b84bb404f9f2d8 to your computer and use it in GitHub Desktop.
Save gnue/ed5250ff83a731a4f0b84bb404f9f2d8 to your computer and use it in GitHub Desktop.
wpa_passphrase 出力で生のパスフレーズを取り除く
#!/bin/bash
usage="Usage: $(basename $0) <ssid>"
fatal() {
echo "$@" >&2
exit 1
}
[ -z "$1" ] && fatal "$usage"
read -sp "Passphrase: " pass
echo -e "\n" >&2
wpa_passphrase "$1" "$pass" | sed '/^\s#psk/d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment