summaryrefslogtreecommitdiffstats
path: root/usr/lib/autowifi/plugins/00profile
blob: d7fb9c75c356ee55566d4b8f771efb5e9868ae27 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
#ESSID MAC CHANNEL ENCRYPTION WPA WPA2
# ENV:
#   root (default: /)
root=${root:-/}
cat $root/etc/autowifi/wifi_keys 2>/dev/null | (while IFS='|' read SSID MAC BANDWIDTH KEY; do
    if [ "$1" == "$SSID" -a "$2" == "$MAC" ]; then
        echo $KEY
        exit 0
    fi
done; exit 1)