Subversion Repositories ALCASAR

Rev

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

Rev 1394 Rev 1395
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1394 2014-06-19 11:25:57Z richard $ 
2
#  $Id: alcasar.sh 1395 2014-06-19 16:13:27Z 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 1254... Line 1254...
1254
##########################################################
1254
##########################################################
1255
nfsen()
1255
nfsen()
1256
{
1256
{
1257
	tar xzf ./conf/nfsen/nfsen-1.3.6p1.tar.gz -C /tmp/
1257
	tar xzf ./conf/nfsen/nfsen-1.3.6p1.tar.gz -C /tmp/
1258
# Add PortTracker plugin
1258
# Add PortTracker plugin
1259
	mkdir -p /var/www/nfsen/plugins /var/log/netflow/porttracker /usr/share/nfsen/plugins
1259
	for i in /var/www/nfsen/plugins /var/log/netflow/porttracker /usr/share/nfsen/plugins
1260
	chown -R apache:apache /var/www/nfsen
-
 
-
 
1260
	do
1261
	chown -R apache:apache /usr/share/nfsen
1261
	[ ! -d $i ] && mkdir $i && chown -R apache:apache $i && echo "$i created" || echo "$i already exists"
1262
	chown -R apache:apache /var/log/netflow
1262
	done
1263
	cp -f $DIR_CONF/nfsen/PortTracker.pm /tmp/nfsen-1.3.6p1/contrib/PortTracker/
1263
	cp -f $DIR_CONF/nfsen/PortTracker.pm /tmp/nfsen-1.3.6p1/contrib/PortTracker/
1264
# use of our conf file and init unit
1264
# use of our conf file and init unit
1265
	cp $DIR_CONF/nfsen/nfsen.conf /tmp/nfsen-1.3.6p1/etc/
1265
	cp $DIR_CONF/nfsen/nfsen.conf /tmp/nfsen-1.3.6p1/etc/
1266
# Installation of nfsen
1266
# Installation of nfsen
1267
	DirTmp=$(pwd)
1267
	DirTmp=$(pwd)
Line 1269... Line 1269...
1269
	/usr/bin/perl5 install.pl etc/nfsen.conf
1269
	/usr/bin/perl5 install.pl etc/nfsen.conf
1270
	/usr/bin/perl5 install.pl etc/nfsen.conf # to avoid a Perl mistake "Semaphore introuvable"
1270
	/usr/bin/perl5 install.pl etc/nfsen.conf # to avoid a Perl mistake "Semaphore introuvable"
1271
# Create RRD DB for porttracker (only in it still doesn't exist)
1271
# Create RRD DB for porttracker (only in it still doesn't exist)
1272
	cp /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.pm /usr/share/nfsen/plugins/
1272
	cp /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.pm /usr/share/nfsen/plugins/
1273
	cp /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.php /var/www/nfsen/plugins/
1273
	cp /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.php /var/www/nfsen/plugins/
1274
	if [ "$(ls -A "/var/log/netflow/porttracker" 2>&1)" = "" ]; then sudo -u apache nftrack -I -d /var/log/netflow/porttracker; else echo "RRD DB already exist"; fi
1274
	if [ "$(ls -A "/var/log/netflow/porttracker" 2>&1)" = "" ]; then sudo -u apache nftrack -I -d /var/log/netflow/porttracker; else echo "RRD DB already exists"; fi
1275
	chown -R apache:apache /var/log/netflow/porttracker/
-
 
1276
	chmod -R 775 /var/log/netflow/porttracker
1275
	chmod -R 770 /var/log/netflow/porttracker
1277
# Apache conf file
1276
# Apache conf file
1278
	cat << EOF > /etc/httpd/conf/conf.d/nfsen.conf
1277
	cat << EOF > /etc/httpd/conf/conf.d/nfsen.conf
1279
Alias /nfsen /var/www/nfsen 
1278
Alias /nfsen /var/www/nfsen 
1280
<Directory /var/www/nfsen/> 
1279
<Directory /var/www/nfsen/> 
1281
DirectoryIndex nfsen.php 
1280
DirectoryIndex nfsen.php