-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmde-setup
executable file
·469 lines (395 loc) · 19.3 KB
/
mde-setup
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
#!/bin/bash
# mindevenviro-fanciful "mde-setup" (install script; "mind eve n viro" SETUP)
# working version: March 2018 ZH.
#
# migration from OSX: I had March 2017, a mid. 2012 Powerbook Pro with HomeBrew,
# clamd, snort, nmap-monitoring, a MAC changer for all interfaces
# and a syntax-editor, writen in shell (bash).
# I had many other scripts I haven't updated into my github account,
# but "sCRYPtUPdater" & "mindevenviro-fanciful" = (minimal deployment environment)
#
# Readings: LPI Linux certification in a nutshell (English)
# LPIC-1: Vorbereitung auf die Pruefung des Linux Professional Institute (German)
#
# Certs: LPIC-1 Test 1, in the Migros Club Schule Basel, PearsonVUE (Oct. 2014)
# LPIC-1 Test 2, in Lima Peru ISIL Campus San Isidro, PearsonVUE (Sept. 2016)
# Certification is valid until Sept. 2021.
# ::Locations::
#
# HZ Peru: Kamin, Suppe, Brot, Tabak, 3.5 CHF pro Tag Job (2016)
#
# BS Schweiz: I thought about the wohle year... (2017)
#
# * STORY LM Peru: I wasted mindevenviro-fanciful away, in October 2017.
# I had some special encodings, like a code from
# outer space in the Putty interface. After entering
# "Reset" in the console, the alien code persists,
# until the SSH connection, has been disconnected from
# myne Windows machine. The Linuxzoo server in the UK
# where closed to me. The web link from Facebook to
# the Linuxzoo server where blocked by Facebook. No Sumerians appear.
#
# ZH CH: They have Wifi and NIC, and now it is, "mind eve n viro" March 2018,
#
# Thank's: "Pinehead.tv Linux Academy", "Fernschule Weber DE", "REVAMP-IT in ZH CH", "Brothuuse ZH", my Tablet.
### WARNING: DON'T EDIT ANYTHING BELOW !!! ###
LANG="C" ;
myPrograms="brutalchess libreoffice-writer tidy cheese gimp scrot mupdf terminator playonlinux wine64 wine64-tools wine64-preloader mercurial libpurple-dev libpurple0 libjson-glib-dev pidgin xul-ext-noscript xul-ext-https-everywhere xul-ext-ublock-origin firefox-esr vlc feh xclip geany transmission xscreensaver wireshark dialog x11-utils vtwm oss-compat alsa-utils xcompmgr x11-apps xdm xorg openvpn zip rar openssl nmap clamav-freshclam clamav-milter clamav-testfiles clamdscan clamassassin clamav clamav-base clamav-daemon apparmor-utils php7.0 php7.0-cli php7.0-mcrypt php7.0-intl php7.0-mysql php7.0-curl php7.0-gd php7.0-soap php7.0-xml php7.0-zip php7.0-readline php7.0-opcache php7.0-json php7.0-gd dwww apache2 libmariadbclient-dev-compat default-libmysqlclient-dev mariadb-client mariadb-common mariadb-server sendmail python-mechanize python-gtk2-dbg shellcheck liblwp-protocol-socks-perl libcgi-pm-perl perl nmon figlet mc mutt eject nano pm-utils fancontrol thermald laptop-mode-tools cpufrequtils wicd " ;
environinstall="monitors/codecounter monitors/logdiskussage monitors/connected network/iptablestranspprox network/server-monitor network/redundanz network/shi3lD network/init/start_shield network/init/stop_shield network/init/nids-antivirus-up network/init/serv-if-up edit/search edit/openpdf edit/sCRYPtUPdater vtwm/feh-bg vtwm/hi vtwm/hi_cheese vtwm/hi_brutalchess vtwm/hi_libreoffice vtwm/hi_geany vtwm/hi_gimp vtwm/hi_transmission-gtk vtwm/hi_firefox-esr vtwm/hi_playonlinux vtwm/hi_vlc vtwm/hi_wicd-client vtwm/hi_xcalc vtwm/hi_shi3lD vtwm/hi_pidgin vtwm/hi_dwecker vtwm/hi_wireshark vtwm/dwecker vtwm/takeshot maintenance/mysql_cp_db maintenance/set_mysql_passwd thirdparty/tor__(test_tor_connexion).pl mde-setup " ;
restarting="6";
readonly empty='';
if [ ! $EUID = 0 ];
then
echo "USAGE: sudo mde-setup, don't run as root!"
exit 0 ;
else
# tmp folder
if [[ "$(df -h | grep -E shm$ | cut -f2 -d% | tr -d '\ ')" != '' ]] ;
then
tmpfolder="$(df -h | grep -E shm$ | cut -f2 -d% | tr -d '\ ')" ;
else
tmpfolder="/tmp" ;
fi
# tmp folder END
# shutting apps and servers down
if [[ "$(ps aux | grep -v grep | grep -v nano | grep -v geany | grep serv-if-up | awk '{print $2}' | wc -l) " -ge "1" ]] ;
then
killall -15 serv-if-up && wait ;
killall -15 shi3lD && wait ;
killall -15 firefox-esr && wait ;
killall -15 pidgin && wait ;
killall -15 vlc && wait ;
fi
# stop END
# enable port forwarding
echo "1" > /proc/sys/net/ipv4/ip_forward;
# environinstall
if [[ $PWD =~ 'mindevenviro-fanciful' ]] ;
then
nNuM1=$(echo "$environinstall" | wc -w) ;
spin2='-\|/' ;
while [[ "$nNuM1" != "0" ]] ;
do
clear ;
toCopyPath=$(awk '{print $'"$nNuM1"'}'<<<"$environinstall") ;
fFILE=$(basename $toCopyPath) ;
sudo cp -f "$PWD/$toCopyPath" "/usr/local/bin/$fFILE" ;
sudo chown root:root "/usr/local/bin/$fFILE" ;
sudo chmod 4755 "/usr/local/bin/$fFILE" ;
sudo chmod u+s "/usr/local/bin/$fFILE" &&
echo -e "\n ... copying files ::\n" ;
i=$(( (i+1) %4 )) ; printf "\r ... ${spin2:$i:1} $fFILE ." | tee -a "/home/$SUDO_USER/.installed" ; sleep .1 ;
((nNuM1--)) ;
done
# environinstall END ...
if [ -e /root/.vendorsmac ] ;
then
echo -e ".vendors macs allready saved" ;
else
echo -e "\n ... save vendors MAC-Address" ;
touch "/root/.vendorsmac" ;
ip link show | grep ether | awk '{print $2}' | tee "/root/.vendorsmac" ;
chmod 0664 "/root/.vendorsmac" ;
fi
echo -e "\n ... if you not have a WiFi device on your Board, then install one please !\n you must have only one WiFi Interface up OR one Wired.\n" ;
if [ -e /root/.interfaces ] ;
then
echo -e ".interfaces allready saved" ;
else
echo -e "\n ... save interfaces" ;
touch "/root/.interfaces" ;
ip link | cut -f2 -d: | grep -E '\ ' | tr -d '\ ' | grep -v lo | tee "/root/.interfaces" ;
chmod 0664 "/root/.interfaces" ;
fi
# set conf file for mysql maintenance
if [[ "$(ls /etc/*)" =~ mysql_cp_db_password.conf ]];
then
echo -e "\n/etc/mysql_cp_db_password.conf allready exists\n" ;
else
cp -f configs/etc/mysql_cp_db_password.conf /etc/mysql_cp_db_password.conf ;
fi
echo -e "\r\n ... clearing files" ;
rm -f /etc/apache2/sites-enabled/000-default.conf 2>/dev/null ;
# by an update clear from double entries in apache2.conf
sed -e '/ServerName /d' /etc/apache2/apache2.conf >| $tmpfolder/apache2.conf 2>/dev/null ;
cp -f $tmpfolder/apache2.conf /etc/apache2/apache2.conf 2>/dev/null ;
# by an update clear from double entries in apache2.conf
sed -e '/Listen /d' /etc/apache2/apache2.conf >| $tmpfolder/apache2.conf 2>/dev/null ;
cp -f $tmpfolder/apache2.conf /etc/apache2/apache2.conf 2>/dev/null ;
###
# by an update clear from double entries in clamd.conf
sed -e '/User /d' /etc/clamav/clamd.conf >| $tmpfolder/clamd.conf 2>/dev/null ;
cp -f $tmpfolder/clamd.conf /etc/clamav/clamd.conf 2>/dev/null ;
# by an update clear from double entries in clamd.conf
sed -e '/ScanOnAccess /d' /etc/clamav/clamd.conf >| $tmpfolder/clamd.conf 2>/dev/null ;
cp -f $tmpfolder/clamd.conf /etc/clamav/clamd.conf 2>/dev/null ;
# by an update clear from double entries in clamd.conf
sed -e '/OnAccessMountPath /d' /etc/clamav/clamd.conf >| $tmpfolder/clamd.conf 2>/dev/null ;
cp -f $tmpfolder/clamd.conf /etc/clamav/clamd.conf 2>/dev/null ;
# by an update clear from double entries in clamd.conf
sed -e '/OnAccessPrevention /d' /etc/clamav/clamd.conf >| $tmpfolder/clamd.conf 2>/dev/null ;
cp -f $tmpfolder/clamd.conf /etc/clamav/clamd.conf 2>/dev/null ;
# by an update clear from double entries in clamd.conf
sed -e '/OnAccessExtraScanning /d' /etc/clamav/clamd.conf >| $tmpfolder/clamd.conf 2>/dev/null ;
cp -f $tmpfolder/clamd.conf /etc/clamav/clamd.conf 2>/dev/null ;
# by an update clear from double entries in clamd.conf
sed -e '/OnAccessExcludeUID /d' /etc/clamav/clamd.conf >| $tmpfolder/clamd.conf 2>/dev/null ;
cp -f $tmpfolder/clamd.conf /etc/clamav/clamd.conf 2>/dev/null ;
# by an update clear from double entries in clamd.conf
sed -e '/VirusEvent /d' /etc/clamav/clamd.conf >| $tmpfolder/clamd.conf 2>/dev/null ;
cp -f $tmpfolder/clamd.conf /etc/clamav/clamd.conf 2>/dev/null ;
###
echo -e "\n ... create /home/$SUDO_USER Directories";
mkdir -p /home/$SUDO_USER/{testphp,testbash,testperl,testpython,Downloads,Pictures,Documents,Music};
chown -R $SUDO_USER:$SUDO_USER /home/$SUDO_USER;
echo -e "\n ... I'm going to install programs\n ... copy sources.list" ;
cp -f configs/etc/sources.list /etc/apt/sources.list ;
# adding an entry to /etc/apt/sources.list.d/
wget -q "http://deb.playonlinux.com/public.gpg" -O- | sudo apt-key add - ;
wget "http://deb.playonlinux.com/playonlinux_jessie.list" -O /etc/apt/sources.list.d/playonlinux.list ;
# to not install systemd related packages
echo -e 'Package: *systemd*\nPin: release *\nPin-Priority: -1\n' > /etc/apt/preferences.d/systemd ;
# install
apt --fix-broken install ;
apt-get -f -y -m install dirmngr git sudo gksu gnupg ;
# adding tors gpg key
echo -e "\n ... adding tors gpg key" ;
gpg --keyserver keyserver.ubuntu.com --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 ;
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add - ;
# update upgrade
echo -e "\n ... update upgrade clean and autoremove" ;
apt-get update && apt-get -f -y -m --allow-change-held-packages upgrade ;
printf "your email-address on github.com: "; read eM4il ;
if [[ "$eM4il" != '' ]] ;
then
sudo -u $SUDO_USER ssh-keygen -t rsa -b 4096 -C "$eM4il" ;
eX1tC0de=$(echo $?) ;
wait ;
if [[ "$eX1tC0de" != 0 ]] ;
then
echo -e "\n REMEMBER ssh-keygen -t rsa -b 4096 -C your-email@server.tld \nto add a github.com account" | tee -a /home/$SUDO_USER/.installed ;
else
cat /home/$SUDO_USER/.ssh/id_rsa.pub >| /home/$SUDO_USER/yourGitHubSSHkey ;
echo -e "\n REMEMBER /home/$SUDO_USER/yourGitHubSSHkey, to add as a new SSH-Key under preferences in your github.com web-account." | tee -a /home/$SUDO_USER/.installed ;
sed -n "s/eval\ //p" /home/$SUDO_USER/.bashrc ;
echo "eval $(ssh-agent -s)" >> /home/$SUDO_USER/.bashrc ;
sed -n "s/ssh-add\ //p" /home/$SUDO_USER/.bashrc ;
echo "ssh-add ~/.ssh/id_rsa" >> /home/$SUDO_USER/.bashrc ;
sudo -u $SUDO_USER ssh -T git@github.com ;
sudo -u $SUDO_USER ssh-keygen -p ;
fi
else
echo " no github.com email."
fi
### install debian apps
nNuM2=$(echo "$myPrograms" | wc -w) ;
until [[ "$nNuM2" = "0" ]] ;
do
toInst=$(awk '{print $'"$nNuM2"'}'<<<"$myPrograms") ;
if [[ "$(dpkg -l | awk '{print $2}' | sed -n "/^$toInst$/p")" != '' ]] ;
then
printf "\r ... testing for apps, $nNuM2 remaining" ; sleep .1 ; ((nNuM2--)) ;
else
echo -e "\ninstalling ${toInst}...\n\r" ;
apt-get -f -m -y --allow-change-held-packages install "$toInst" | tee -a "/home/$SUDO_USER/.installed" ;
eX1tC0de=$(echo $?);
wait;
if [[ "$eX1tC0de" != 0 ]];
then
apt --fix-broken install ;
else
wait ;
sleep 1 ;
apPR="$toInst, INSTALLED!" ;
echo -e "\n$apPR\n" | tee -a "/home/$SUDO_USER/.installed" ;
((nNuM2--)) ;
fi
fi
if [ "$nNuM2" = "0" ]
then
### install sysvinit-core and remove systemd
echo -e "\rchange the physiology to original\n" ;
apt-get -f -m -y --allow-change-held-packages install sysvinit-core | tee -a "/home/$SUDO_USER/.installed" ;
wait ;
cp -f /usr/share/sysvinit/inittab /etc/inittab ;
echo -e "\nsysvinit-core, INSTALLED!\n" | tee -a "/home/$SUDO_USER/.installed" ;
echo -e "\nremove odd characters\n";
apt-get -f -m -y remove --purge --auto-remove systemd* ;
wait ;
echo -e "\nupdate hwdb --usr\n";
systemd-hwdb --usr update ;
wait ;
echo -e "\nsystemd removed !\n";
echo -e "\n ... apt-get done.\n";
sleep 3;
fi
done
# install END
if [[ "$(grep -E "root: ivo" /etc/aliases)" != '' ]] ;
then
echo -e "\n ... Alias Database newaliases allready build.\n if you want to do an other alias please edit /etc/aliases" ;
else
echo -e "\n ... updating /etc/aliases, this may take a while" ;
echo "root: $SUDO_USER" >> /etc/aliases ;
newaliases ;
sleep 2 ;
echo -e "\n ... /etc/aliases updated, you are able to read root mails." ;
fi
echo -e "\n ... copy default wake-up tune...\n\r" ;
cp vtwm/wakeup.mp3 /home/$SUDO_USER/.config/ ;
chown $SUDO_USER:$SUDO_USER /home/$SUDO_USER/.config/wakeup.mp3 ;
echo -e "\n ... copy VLC skin, playlist-to-overwrite, must be the same name...\n\r" ;
cp configs/myMusic.m3u /home/$SUDO_USER/Music/ 2>/dev/null ;
cp -f thirdparty/default.vlt /usr/share/vlc/skins2/ ;
chmod 755 /usr/share/vlc/skins2/default.vlt ;
chown -R $SUDO_USER:$SUDO_USER /usr/share/vlc/skins2/default.vlt ;
echo -e "\n ... copy welcome tune...\n\r" ;
cp vtwm/beneathTheRedHouse.m3u /home/$SUDO_USER/.config/ ;
chown $SUDO_USER:$SUDO_USER /home/$SUDO_USER/.config/beneathTheRedHouse.m3u ;
cp vtwm/beneathTheRedHouse.m4a /home/$SUDO_USER/.config/ ;
chown $SUDO_USER:$SUDO_USER /home/$SUDO_USER/.config/beneathTheRedHouse.m4a ;
echo -e "\n ... copy default apache2 site available...\n\r" ;
cp configs/000-default.conf /etc/apache2/sites-available/ ;
chown -R $SUDO_USER:$SUDO_USER /etc/apache2/sites-available/000-default.conf ;
echo -e "\n ... settings for firefox-esr...\n\r" ;
rm -fdR /home/"$SUDO_USER"/.mozilla/firefox/*.default ;
mkdir -p /home/"$SUDO_USER"/.mozilla/firefox/ar37ud1e.default ;
chmod 700 /home/"$SUDO_USER"/.mozilla/firefox/ar37ud1e.default ;
chown $SUDO_USER:$SUDO_USER /home/"$SUDO_USER"/.mozilla/firefox/ar37ud1e.default ;
cp -f configs/profiles.ini /home/"$SUDO_USER"/.mozilla/firefox/ ;
chmod 600 /home/"$SUDO_USER"/.mozilla/firefox/profiles.ini ;
chown $SUDO_USER:$SUDO_USER /home/"$SUDO_USER"/.mozilla/firefox/profiles.ini ;
cp -f configs/prefs.js /home/"$SUDO_USER"/.mozilla/firefox/ar37ud1e.default/ ;
cp -f configs/prefs.js /home/"$SUDO_USER"/.prefs.js ;
cp -f configs/duckduckgo.xml /usr/share/firefox-esr/distribution/searchplugins/common/ ;
chmod 600 /home/"$SUDO_USER"/.mozilla/firefox/ar37ud1e.default/* ;
chown $SUDO_USER:$SUDO_USER /home/"$SUDO_USER"/.mozilla/firefox/ar37ud1e.default/* ;
echo -e "\n ... copy logoutvtwm...\n\r" ;
cp -f configs/logoutvtwm /etc/X11/Xreset.d/ ;
chmod a+x /etc/X11/Xreset.d/logoutvtwm ;
echo -e "\n ... update pm-utils script to interact with laptop-mode-tools...\n\r" ;
cp -f thirdparty/10-laptop-mode-tools /etc/pm/sleep.d/ ;
chmod a+x /etc/pm/sleep.d/10-laptop-mode-tools ;
echo -e "\n ... installing flash player for linux...\n\r" ;
tar -xf /home/$SUDO_USER/mindevenviro-fanciful/thirdparty/flash_player_npapi_linux.x86_64.tar.gz ;
cp -f libflashplayer.so /usr/lib/mozilla/plugins/ ;
cp -rf usr/* /usr/ ;
rm -dRf LGPL/ usr/ libflashplayer.so license.pdf readme.txt ;
echo -e "\n ... copy .bashrc...\n\r" ;
cp -f configs/bashrc /home/$SUDO_USER/.bashrc ;
chmod 644 /home/$SUDO_USER/.bashrc ;
echo -e "\n ... copy mindevenviro-fanciful.xpm...\n\r" ;
cp -f pictures/mindevenviro-fanciful.xpm /usr/share/X11/xdm/pixmaps/mindevenviro-fanciful.xpm ;
chmod 644 /usr/share/X11/xdm/pixmaps/mindevenviro-fanciful.xpm ;
echo -e "\n ... copy Xresources...\n\r" ;
cp -f configs/debian/Xresources /etc/X11/xdm/ ;
chmod 755 /etc/X11/xdm/Xresources ;
echo -e "\n ... copy the .xscreensaver file to /home/$SUDO_USER...\n\r" ;
cp -f configs/debian/xscreensaver /home/$SUDO_USER/.xscreensaver ;
chown $SUDO_USER:$SUDO_USER /home/$SUDO_USER/.xscreensaver ;
echo -e "\n ... copy the ini file to /home/$SUDO_USER/.config/mc/...\n\r" ;
mkdir -p /home/$SUDO_USER/.config/mc 2>/dev/null ;
cp -f configs/ini /home/$SUDO_USER/.config/mc/ini ;
chown $SUDO_USER:$SUDO_USER /home/$SUDO_USER/.config ;
echo -e "\n ... copy the config file to /home/$SUDO_USER/.config/terminator/config...\n\r" ;
mkdir -p /home/$SUDO_USER/.config/terminator 2>/dev/null ;
cp -f configs/config /home/$SUDO_USER/.config/terminator/config ;
chown $SUDO_USER:$SUDO_USER /home/$SUDO_USER/.config ;
echo -e "\n ... copy the .twmrc file to /home/$SUDO_USER...\n\r" ;
cp -f configs/twmrc /home/$SUDO_USER/.twmrc ;
chown $SUDO_USER:$SUDO_USER /home/$SUDO_USER/.twmrc ;
# Apache2 setup
echo -e "\n ... set the upload path for PHP scripts...\n\r" ;
rm -f /var/www/html/index*
mkdir -p /var/www/html/{testphp,pics} ; 2>/dev/null ;
cp -f docs/pics/* /var/www/html/pics/ ;
cp -f configs/README.html /var/www/html/testphp/ ;
chown -R www-data:www-data /var/www/html/ ;
# Antivirus
cp -f configs/clamd-response /etc/clamav/virusevent.d/clamd-response
echo "User root" | tee -a /etc/clamav/clamd.conf ;
echo "ScanOnAccess true" | tee -a /etc/clamav/clamd.conf ;
echo "OnAccessMountPath /" | tee -a /etc/clamav/clamd.conf ;
echo "OnAccessMountPath /home/" | tee -a /etc/clamav/clamd.conf ;
echo "OnAccessPrevention false" | tee -a /etc/clamav/clamd.conf ;
echo "OnAccessExtraScanning true" | tee -a /etc/clamav/clamd.conf ;
echo "OnAccessExcludeUID 0" | tee -a /etc/clamav/clamd.conf ;
echo "VirusEvent /etc/clamav/virusevent.d/clamd-response" | tee -a /etc/clamav/clamd.conf ;
aa-complain clamd ;
wait ;
# mkdir cgi-bin
mkdir -p /usr/lib/cgi-bin/ 2>/dev/null ;
# add a ServerName to your conf
echo "ServerName $(hostname)" >> /etc/apache2/apache2.conf ;
echo "Listen 127.0.1.1:80" >> /etc/apache2/apache2.conf ;
# updates the address for localhost
echo -e "\n ... update apache2 configuration...\n\r" ;
a2enmod cgid ;
a2enmod proxy_http ;
echo -e "\n ... restarting apache2 server...\n\r" ;
/etc/init.d/apache2 restart ;
# Apache2 setup END
echo -e "\n ... installing snort...\n\r" ;
apt-get -f -m -y --allow-change-held-packages install snort ;
# reconfigure all
echo -e "\n ... reconfiguring installed packages...\n\r" ;
dpkg --configure -a ;
# add i386 arch in 64bit system, to install wine32
echo -e "\n ... add i386 arch in 64bit system, to install wine32...\n\r" ;
dpkg --add-architecture i386 && apt-get update && apt-get -f -y -m --allow-change-held-packages install wine32 ;
# installing tor
apt-get -f -y -m install tor deb.torproject.org-keyring && wait ;
sleep 1 ;
# configuring torrc
if [[ "$(cat /etc/tor/torrc | sed -n '/DNSPort\ 53/p')" = '' ]] ;
then
echo -e "\n
VirtualAddrNetworkIPv4 10.192.0.0/10\r
AutomapHostsOnResolve 1\r
TransPort 9040\r
DNSPort 53\r">>/etc/tor/torrc;
else
echo -e "\n ... tor allready configured...\n\r" ;
fi
echo -e "\n ... set background Pictures...\n\r" ;
mkdir -p /home/$SUDO_USER/wallpapers 2>/dev/null ;
unzip -o pictures/wallpapers.zip -d /home/$SUDO_USER/wallpapers ;
chown -R $SUDO_USER:$SUDO_USER /home/$SUDO_USER/wallpapers/* ;
chmod 0755 /home/$SUDO_USER/wallpapers/* ;
echo -e "\n ... set the rights for .wH0rUNSon...\n\r" ;
if [ -e /home/$SUDO_USER/.wH0rUNSon ] ;
then
echo -e "...wH0rUNSon allready installed...\n" | tee -a "/home/$SUDO_USER/.installed" ;
else
touch "/home/$SUDO_USER/.wH0rUNSon" && chown $SUDO_USER:$SUDO_USER "/home/$SUDO_USER/.wH0rUNSon" && chmod 0660 "/home/$SUDO_USER/.wH0rUNSon" | tee -a "/home/$SUDO_USER/.installed" ;
fi
# cooling
pwmconfig ;
# cleaning the environment
apt-get clean &&
apt -f -y -m autoremove ;
echo -e "\n ... successfully_installed $(date), by $USER" | tee -a /home/$SUDO_USER/.installed ;
echo -e "\n ... Congratulations we have M1ND3V3NV1R0 successfully installed!" ;
echo -e "\n ... your System will be rebooted. do you want to proceed? [y/n]: " ;
read -r restartORnot ;
if [[ $restartORnot =~ y|Y|s|S|j|J ]] ;
then
until [[ $restarting = 0 ]] ;
do
((restarting--)) ;
printf "\r I will restart in $restarting seconds ..." ; sleep 1 ;
done && stop_shield --stop ; init 6
else
echo -e "\n ... OK!" ;
# start serv-if-up again.
redundanz --redundanz &
# good bye
echo "good bye $SUDO_USER" ;
exit 0 ;
fi
else
echo -e "\n M1ND3V3NV1R0 allready installed!\n run this script from within the folder M1ND3V3NV1R0, after installation, system will restart." ;
echo -e "\n you should be in the M1ND3V3NV1R0 folder."
exit 0 ;
fi
fi