Subversion Repositories ALCASAR

Rev

Rev 1511 | Rev 1513 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1511 Rev 1512
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1511 2014-12-01 17:15:27Z richard $ 
2
#  $Id: alcasar.sh 1512 2014-12-01 23:07:12Z richard $ 
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
 
5
 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
7
# Ce programme est un logiciel libre ; This software is free and open source
7
# Ce programme est un logiciel libre ; This software is free and open source
Line 1299... Line 1299...
1299
	      userdel -r tinyproxy 2>/dev/null
1299
	      userdel -r tinyproxy 2>/dev/null
1300
	      groupdel tinyproxy 2>/dev/null
1300
	      groupdel tinyproxy 2>/dev/null
1301
	fi
1301
	fi
1302
	groupadd -f tinyproxy
1302
	groupadd -f tinyproxy
1303
	useradd -r -g tinyproxy -s /bin/false -c "system user for tinyproxy" tinyproxy
1303
	useradd -r -g tinyproxy -s /bin/false -c "system user for tinyproxy" tinyproxy
1304
	mkdir -p /var/log/tinyproxy /var/run/tinyproxy
1304
	mkdir -p /var/run/tinyproxy
1305
	chown -R tinyproxy:tinyproxy /var/log/tinyproxy /var/run/tinyproxy
1305
	chown tinyproxy:tinyproxy /var/run/tinyproxy
1306
	[ -e /etc/tinyproxy/tinyproxy.conf.default ] || cp /etc/tinyproxy/tinyproxy.conf /etc/tinyproxy/tinyproxy.conf.default
1306
	[ -e /etc/tinyproxy/tinyproxy.conf.default ] || cp /etc/tinyproxy/tinyproxy.conf /etc/tinyproxy/tinyproxy.conf.default
1307
	$SED "s?^User.*?User tinyproxy?g" /etc/tinyproxy/tinyproxy.conf
1307
	$SED "s?^User.*?User tinyproxy?g" /etc/tinyproxy/tinyproxy.conf
1308
	$SED "s?^Group.*?Group tinyproxy?g" /etc/tinyproxy/tinyproxy.conf
1308
	$SED "s?^Group.*?Group tinyproxy?g" /etc/tinyproxy/tinyproxy.conf
1309
	$SED "s?^Port.*?Port 8090?g" /etc/tinyproxy/tinyproxy.conf			# Listen Port
1309
	$SED "s?^Port.*?Port 8090?g" /etc/tinyproxy/tinyproxy.conf			# Listen Port
1310
	$SED "s?^#Listen.*?Listen $PRIVATE_IP?g" /etc/tinyproxy/tinyproxy.conf		# Listen NIC (only intif)
1310
	$SED "s?^#Listen.*?Listen $PRIVATE_IP?g" /etc/tinyproxy/tinyproxy.conf		# Listen NIC (only intif)
Line 1371... Line 1371...
1371
{
1371
{
1372
	tar xzf ./conf/nfsen/nfsen-1.3.6p1.tar.gz -C /tmp/
1372
	tar xzf ./conf/nfsen/nfsen-1.3.6p1.tar.gz -C /tmp/
1373
# Add PortTracker plugin
1373
# Add PortTracker plugin
1374
	for i in /var/www/nfsen/plugins /var/log/netflow/porttracker /usr/share/nfsen/plugins
1374
	for i in /var/www/nfsen/plugins /var/log/netflow/porttracker /usr/share/nfsen/plugins
1375
	do
1375
	do
1376
	[ ! -d $i ] && mkdir $i && chown -R apache:apache $i && echo "$i created" || echo "$i already exists"
1376
	[ ! -d $i ] && mkdir $i && chown -R apache:apache $i
1377
	done
1377
	done
1378
	$SED "s?^my \$PORTSDBDIR =.*?my \$PORTSDBDIR = \"/var/log/netflow/porttracker\"?g" /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.pm
1378
	$SED "s?^my \$PORTSDBDIR =.*?my \$PORTSDBDIR = \"/var/log/netflow/porttracker\"?g" /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.pm
1379
# use of our conf file and init unit
1379
# use of our conf file and init unit
1380
	cp $DIR_CONF/nfsen/nfsen.conf /tmp/nfsen-1.3.6p1/etc/
1380
	cp $DIR_CONF/nfsen/nfsen.conf /tmp/nfsen-1.3.6p1/etc/
1381
# Installation of nfsen
1381
# Installation of nfsen
Line 1435... Line 1435...
1435
# expire delay for the profile "live"
1435
# expire delay for the profile "live"
1436
	systemctl start nfsen
1436
	systemctl start nfsen
1437
	/bin/nfsen -m live -e 62d 2>/dev/null
1437
	/bin/nfsen -m live -e 62d 2>/dev/null
1438
# add SURFmap plugin
1438
# add SURFmap plugin
1439
	cp $DIR_CONF/nfsen/SURFmap_v3.3.1.tar.gz /tmp/
1439
	cp $DIR_CONF/nfsen/SURFmap_v3.3.1.tar.gz /tmp/
-
 
1440
	cp $DIR_CONF/nfsen/GeoLiteCity* /tmp/
1440
	tar xzf /tmp/SURFmap_v3.3.1.tar.gz -C /tmp/
1441
	tar xzf /tmp/SURFmap_v3.3.1.tar.gz -C /tmp/
1441
	cp $DIR_CONF/nfsen/GeoLiteCity* /tmp/SURFmap/
-
 
1442
	cd /tmp/SURFmap/
1442
	cd /tmp/
1443
	/usr/bin/sh install.sh
1443
	/usr/bin/sh SURFmap/install.sh
1444
 
-
 
1445
# clear the installation
1444
# clear the installation
1446
	cd $DirTmp
1445
	cd $DirTmp
1447
	rm -rf /tmp/nfsen*
1446
	rm -rf /tmp/nfsen*
1448
	rm -rf /tmp/SURFmap*
1447
	rm -rf /tmp/SURFmap*
1449
} # End of nfsen ()
1448
} # End of nfsen ()