blob: 1c16b9fccbcef81a84f6025a0e02126dbb249091 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 | #!/bin/sh
DEV=`ls -1 /sys/class/net | grep wifi`
if [[ $DEV == "" ]]; then
  DEV=`ls -1 /sys/class/net | grep wlan`
fi
setup_wifi()
{
  if [[ $1 != "home" && $1 != "hotspot" ]]; then
    sudo macchanger -e $DEV
  fi
  sudo wpa_supplicant -i $DEV -c ~/.net_profiles/$1.conf &>/tmp/wpa_supplicant.log &
  sudo /etc/init.d/dhcpcd start
  sleep 30
  sudo rc-config start ntp-client
}
if [ ! -f ~/.net_profiles/$1.conf ]; then
  echo "no such profile"
  exit
fi
setup_wifi $1
 |