summaryrefslogtreecommitdiffstats
path: root/usr/lib/autowifi/plugins/00profile
blob: fdba2c9e4582d8d05324e129840dc390b89c7c7b (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 KEY; do
    if [ "$1" == "$SSID" -a "$2" == "$MAC" ]; then
        echo $KEY
        exit 0
    fi
done; exit 1)