WiFi works!!! A successful experience. [ SCRIPTS PROVIDED ] » connect.sh
| 1 | #
 | 
|---|---|
| 2 | #	     THIS IS FREE SOFTWARE 
 | 
| 3 | #
 | 
| 4 | # Copyright 2016 Filippo "Fil" Bergamo
 | 
| 5 | # 
 | 
| 6 | # Licensed under the Apache License, Version 2.0 (the "License");
 | 
| 7 | # you may not use this file except in compliance with the License.
 | 
| 8 | # You may obtain a copy of the License at
 | 
| 9 | # 
 | 
| 10 | #     http://www.apache.org/licenses/LICENSE-2.0
 | 
| 11 | # 
 | 
| 12 | # Unless required by applicable law or agreed to in writing, software
 | 
| 13 | # distributed under the License is distributed on an "AS IS" BASIS,
 | 
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
| 15 | # See the License for the specific language governing permissions and
 | 
| 16 | # limitations under the License.
 | 
| 17 |  | 
| 18 |  | 
| 19 | scriptDiscon=/data/misc/wifi/disconnect.sh | 
| 20 | pidfile=/data/misc/wifi/pidfile | 
| 21 | configfile=/data/misc/wifi/wpa_supplicant.conf | 
| 22 | ifacename=wlan0 | 
| 23 | ipDNS1=193.183.98.154 | 
| 24 | ipDNS2=87.98.175.85 | 
| 25 |  | 
| 26 | # terminate both dhcpcd and wpa_supplicant, in case there are previous connections pending...
 | 
| 27 | bash $scriptDiscon
 | 
| 28 |  | 
| 29 | # launch wpa_supplicant on interface wlan0
 | 
| 30 | # specifing our custom configuration and the socket file
 | 
| 31 | wpa_supplicant -B -dd -i$ifacename -c$configfile -P$pidfile | 
| 32 | dhcpcd $ifacename
 | 
| 33 | setprop net.dns1 $ipDNS1
 | 
| 34 | setprop net.dns2 $ipDNS2
 |