-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure
74 lines (56 loc) · 1.66 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
# Wifi
# A wifi tool set from command line
# Configuration file
# License: GPL v2 or later
# Author: Aurelien DESBRIERES - [email protected]
tput clear
echo "Welcome to Wifi tools set from command line"
echo "This program will install needed dependencies"
echo "You need root privileges to run it"
the_user=`whoami`
# request the user approbation
while true; do
read -p "Do you wish to install wifi tool set $the_user? Y/n " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer Yes or no.";;
esac
done
# Vefify and install the dependencies if needed
printf "\nThe software will now get the needed dependencies for your\noperating system $the_user\n"
# load installation of the dependencies
# verification of the package manager
command_exists () {
type "$1" &> /dev/null ;
}
# auto-selection of the package manager
# dnf - Fedora - fredora
if command_exists dnf ; then
sudo dnf install nmap moreutils
else
# yum - RedHat - old fredora
sudo yum install nmap moreutils
fi
# apt - Debian - Trisquel
if command_exists apt-get ; then
sudo apt-get install nmap moreutils
fi
# pacman - Archlinux - Parabola
if command_exists pacman ; then
sudo pacman -Sy nmap moreutils
fi
# apt - Rooted smartphone
if command_exists apt ; then
sudo apt install nmap moreutils
fi
mkdir /home/$the_user/wifi-ts/
cp wifi scan.awk ~/wifi-ts/
chmod u+x ~/wifi-ts/wifi
cd ~/wifi-ts/
touch wifi-report-scan #create a file (to have not a missing file trouble during first execution)
printf "If all dependencies installed correctly, Wifi tool set will be able to\nrun correctly on your operating system $the_user\n"
sleep 5
. wifi
wifi