Subversion Repositories Projects

Rev

Rev 308 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
308 dhylands 1
#!/bin/sh
2
#
3
# Script which checks to see if we're at home
4
#
5
# Check to see if we're on my wireless LAN
6
#
7
# For reference, the output of iwconfig looks like this when associated:
8
#
9
# eth1      IEEE 802.11b/g  ESSID:"Seeker-WLAN"  Nickname:"Broadcom 4306"
10
#           Mode:Managed  Frequency=2.437 GHz  Access Point: 00:00:00:00:00:00   
11
#           Bit Rate=24 Mb/s   Tx-Power=15 dBm   
12
#           RTS thr:off   Fragment thr:off
13
#           Link Quality=60/100  Signal level=-62 dBm  Noise level=-72 dBm
14
#           Rx invalid nwid:0  Rx invalid crypt:30678  Rx invalid frag:0
15
#           Tx excessive retries:0  Invalid misc:0   Missed beacon:0
16
 
17
SSID=$(/sbin/iwconfig 2>&1 | grep ESSID | sed -e 's/^.*ESSID://' -e 's/ .*//' -e 's/"//g')
18
 
19
case "${SSID}" in
20
 
21
    Blue-Heron*)
22
        echo "$(date): SSID: ${SSID}: Home network detected"
23
        exit 0
24
        ;;
25
 
26
    *)
27
        echo "$(date): SSID ${SSID}: Not on home network"
28
        exit 1
29
        ;;
30
esac
31