Replace three `git sht` with the proper `git log --format=%h`
[sunny256-utils.git] / wlan1
blobe595ec22f61e31a9121fe23a97d8718c1ffb2626
1 #!/usr/bin/env bash
3 #=======================================================================
4 # wlan1
5 # File ID: c4393f36-5d49-11df-8d2c-90e6ba3022ac
6 # Activates the network card.
7 # Syntax: wlan1 [essid]
8 #=======================================================================
10 [ "`whoami`" = "root" ] || {
11 echo `basename $0`: Heh, you ain’t got root power. Gonna need that, mate. >&2
12 exit 1
15 unset accpoint
16 if [ "$1" = "" ]; then
17 accpoint="$1"
19 modprobe ath_pci
20 modprobe wlan_scan_sta
21 ifconfig ath0 up
22 echo ==== Waiting for ath0... ====
23 until grep ath0 /proc/net/wireless; do :; done
24 sleep 1
25 echo
26 echo ==== Available networks: ====
27 wlanconfig ath0 list scan
28 echo
29 if [ -z $accpoint ]; then
30 echo iwconfig ath0 ap any ap any
31 iwconfig ath0 ap any ap any
32 else
33 echo iwconfig ath0 ap \"$accpoint\"
34 iwconfig ath0 ap "$accpoint"
36 echo
37 echo ======== BEGIN iwconfig ========
38 iwconfig ath0
39 echo ======== END iwconfig ========
40 echo
41 dhclient ath0