forked from xtr4nge/FruityWifi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-FruityWifi.sh
executable file
·202 lines (164 loc) · 4.61 KB
/
install-FruityWifi.sh
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#!/bin/bash
find FruityWifi -type d -exec chmod 755 {} \;
find FruityWifi -type f -exec chmod 644 {} \;
mkdir tmp-install
cd tmp-install
apt-get update
apt-get -y install gettext make intltool build-essential automake autoconf uuid uuid-dev php5-curl php5-cli dos2unix curl sudo
cmd=`gcc --version|grep "4.7"`
if [[ $cmd == "" ]]
then
echo "--------------------------------"
echo "Installing gcc 4.7"
echo "--------------------------------"
#exit;
apt-get -y install gcc-4.7
apt-get -y install g++-4.7
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7
else
echo "--------------------------------"
echo "gcc 4.7 already installed"
echo "--------------------------------"
echo
echo
fi
echo
if [ ! -f "/usr/sbin/dnsmasq" ]
then
echo "--------------------------------"
echo "Installing dnsmasq"
echo "--------------------------------"
#exit;
# INSTALL DNSMASQ
apt-get -y install dnsmasq
else
echo "--------------------------------"
echo "dnsmasq already installed"
echo "--------------------------------"
echo
echo
fi
echo
if [ ! -f "/usr/sbin/hostapd" ]
then
echo "--------------------------------"
echo "Installing hostapd"
echo "--------------------------------"
#exit;
# INSTALL HOSTAPD
apt-get -y install hostapd
else
echo "--------------------------------"
echo "hostapd already installed"
echo "--------------------------------"
echo
echo
fi
echo
if [ ! -f "/usr/sbin/airmon-ng" ] && [ ! -f "/usr/local/sbin/airmon-ng" ]
then
echo "--------------------------------"
echo "Installing aircrack-ng"
echo "--------------------------------"
#exit;
# INSTALL AIRCRACK-NG
apt-get -y install libssl-dev
wget http://download.aircrack-ng.org/aircrack-ng-1.2-beta1.tar.gz
tar -zxvf aircrack-ng-1.2-beta1.tar.gz
cd aircrack-ng-1.2-beta1
make
make install
cd ../
else
echo "--------------------------------"
echo "aircrack-ng already installed"
echo "--------------------------------"
echo
echo
fi
echo
if [ ! -f "/usr/sbin/nginx" ]
then
echo "--------------------------------"
echo "Installing Nginx"
echo "--------------------------------"
#exit;
# NGINX INSTALL
apt-get -y install nginx php5-fpm
# SSL
echo "--------------------------------"
echo "Create Nginx ssl certificate"
echo "--------------------------------"
mkdir /etc/nginx/ssl
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt
rm /etc/nginx/sites-enabled/default
cp nginx-setup/FruityWifi /etc/nginx/sites-enabled/
cp nginx-setup/fpm/*.conf /etc/php5/fpm/pool.d/
echo "." >> /var/www/index.php
/etc/init.d/apache2 stop
/etc/init.d/nginx restart
/etc/init.d/php5-fpm restart
else
echo "--------------------------------"
echo "Nginx already installed"
echo "--------------------------------"
echo
echo
fi
echo
#if [ ! -f "/usr/sbin/apache2" ]
#then
# echo "--------------------------------"
# echo "Installing apache2"
# echo "--------------------------------"
# #exit;
#
# # APACHE2 INSTALL
# apt-get -y install apache2 php5 libapache2-mod-php5 php5-curl
#
#else
# echo "--------------------------------"
# echo "apache2 already installed"
# echo "--------------------------------"
# echo
# echo
#fi
echo "--------------------------------"
echo "Setup: WWW"
echo "--------------------------------"
mkdir /var/www
cmd=`date +"%Y-%m-%d-%k-%M-%S"`
cd ../
mv /usr/share/FruityWifi FruityWifi.BAK.$cmd
rm /var/www/FruityWifi
cp -a FruityWifi /usr/share/FruityWifi
ln -s /usr/share/FruityWifi/www /var/www/FruityWifi
ln -s /usr/share/FruityWifi/logs /var/www/FruityWifi/logs
mkdir /var/www/tmp
chown www-data.www-data /var/www/tmp
chmod 777 /var/www/tmp
chmod 755 /usr/share/FruityWifi/squid.inject/poison.pl
ln -s /usr/share/FruityWifi/www.site /var/www/site
chown -R www-data.www-data /usr/share/FruityWifi/www.site
chmod 777 /usr/share/FruityWifi/www.site/data.txt
chmod 777 /usr/share/FruityWifi/www.site/inject/data.txt
# BIN
cd /usr/share/FruityWifi/bin/
gcc danger.c -o danger
chmod 4755 danger
echo
# START/STOP SERVICES
echo "--------------------------------"
echo "Start Services"
echo "--------------------------------"
update-rc.d ssh defaults
update-rc.d nginx defaults
update-rc.d ntp defaults
update-rc.d -f apache2 remove
/etc/init.d/apache2 stop
/etc/init.d/nginx restart
/etc/init.d/php5-fpm restart
apt-get -y remove ifplugd
echo
echo "ENJOY!"
echo ""