Project

General

Profile

WiFi works!!! A successful experience. [ SCRIPTS PROVIDED ] » rstr.sh

sets up or restores the working environment - Fil Bergamo, 11/21/2016 04:49 PM

 
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
workdir=/data/misc/wifi
19
wpaconfile=/data/misc/wifi/wpa_supplicant.conf
20
scriptChkMod=/data/misc/wifi/check_modules.sh
21

    
22
echo "Beginning a best-effort attempt to setup/restore Libre WiFi connectivity:"
23

    
24
idx=1
25

    
26
echo -n $idx") chmod -R 777 $workdir... "
27
chmod -R 777 $workdir
28
if [ $? = 0 ]; then
29
	echo " [ OK! ]"
30
else
31
	echo " [* FAIL! *]"
32
fi
33

    
34
if [ -e $wpaconfile ]; then
35

    
36
	idx=$(($idx+1))
37
	echo -n $idx") chmod 777 $wpaconfile... "
38
	chmod 777 $wpaconfile
39
	if [ $? = 0 ]; then
40
		echo " [ OK! ]"
41
	else
42
		echo " [* FAIL! *]"
43
	fi
44
fi
45

    
46
idx=$(($idx+1))
47
echo $idx") Check and load needed modules:"
48
source $scriptChkMod
(6-6/7)