summaryrefslogtreecommitdiff
path: root/roles/ws/minet/templates/connections/wifiScan.j2
blob: 83d6e9f81c2221d07e9b0aea03c8b74a3d2032cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

SHORT_NAME="wifiScan"
DESC_NAME="do a Wifi Scan"
INTERFACE="{{ ws_minet_wireless_interface_name }}"
MODULE_NAME="{{ ws_minet_wireless_interface_module }}"

. /usr/local/lib/minet/minet_helpers.sh

case "$1" in
  start|"")
    echo "$DESC_NAME"
    activate_interface $INTERFACE $MODULE_NAME
    iw $INTERFACE scan | grep -B 9 'SSID:'
    deactivate_interface $INTERFACE $MODULE_NAME
    ;;
  stop)
    ;;
  *)
    exit 1
    ;;
esac