Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 1567 2015-02-11 23:11:33Z richard $
|
2 |
# $Id: alcasar.sh 1569 2015-02-13 20:08:56Z 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 1396... |
Line 1396... |
1396 |
## - install the nfsen grapher ##
|
1396 |
## - install the nfsen grapher ##
|
1397 |
## - install the two plugins porttracker & surfmap ##
|
1397 |
## - install the two plugins porttracker & surfmap ##
|
1398 |
##########################################################
|
1398 |
##########################################################
|
1399 |
nfsen()
|
1399 |
nfsen()
|
1400 |
{
|
1400 |
{
|
1401 |
tar xzf ./conf/nfsen/nfsen-1.3.6p1.tar.gz -C /tmp/
|
1401 |
tar xzf ./conf/nfsen/nfsen-1.3.7.tar.gz -C /tmp/
|
1402 |
# Add PortTracker plugin
|
1402 |
# Add PortTracker plugin
|
1403 |
for i in /var/www/html/acc/manager/nfsen/plugins /var/log/netflow/porttracker /usr/share/nfsen/plugins
|
1403 |
for i in /var/www/html/acc/manager/nfsen/plugins /var/log/netflow/porttracker /usr/share/nfsen/plugins
|
1404 |
do
|
1404 |
do
|
1405 |
[ ! -d $i ] && mkdir -p $i && chown -R apache:apache $i
|
1405 |
[ ! -d $i ] && mkdir -p $i && chown -R apache:apache $i
|
1406 |
done
|
1406 |
done
|
1407 |
$SED "s?^my \$PORTSDBDIR =.*?my \$PORTSDBDIR = \"/var/log/netflow/porttracker\";?g" /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.pm
|
1407 |
$SED "s?^my \$PORTSDBDIR =.*?my \$PORTSDBDIR = \"/var/log/netflow/porttracker\";?g" /tmp/nfsen-1.3.7/contrib/PortTracker/PortTracker.pm
|
1408 |
# use of our conf file and init unit
|
1408 |
# use of our conf file and init unit
|
1409 |
cp $DIR_CONF/nfsen/nfsen.conf /tmp/nfsen-1.3.6p1/etc/
|
1409 |
cp $DIR_CONF/nfsen/nfsen.conf /tmp/nfsen-1.3.7/etc/
|
1410 |
# Installation of nfsen
|
1410 |
# Installation of nfsen
|
1411 |
DirTmp=$(pwd)
|
1411 |
DirTmp=$(pwd)
|
1412 |
cd /tmp/nfsen-1.3.6p1/
|
1412 |
cd /tmp/nfsen-1.3.7/
|
1413 |
/usr/bin/perl5 install.pl etc/nfsen.conf
|
1413 |
/usr/bin/perl5 install.pl etc/nfsen.conf
|
1414 |
/usr/bin/perl5 install.pl etc/nfsen.conf # to avoid a Perl mistake "Semaphore introuvable"
|
1414 |
/usr/bin/perl5 install.pl etc/nfsen.conf # to avoid a Perl mistake "Semaphore introuvable"
|
1415 |
# Create RRD DB for porttracker (only in it still doesn't exist)
|
1415 |
# Create RRD DB for porttracker (only in it still doesn't exist)
|
1416 |
cp /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.pm /usr/share/nfsen/plugins/
|
1416 |
cp /tmp/nfsen-1.3.7/contrib/PortTracker/PortTracker.pm /usr/share/nfsen/plugins/
|
1417 |
cp /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.php /var/www/html/acc/manager/nfsen/plugins/
|
1417 |
cp /tmp/nfsen-1.3.7/contrib/PortTracker/PortTracker.php /var/www/html/acc/manager/nfsen/plugins/
|
1418 |
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
|
1418 |
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
|
1419 |
chmod -R 770 /var/log/netflow/porttracker
|
1419 |
chmod -R 770 /var/log/netflow/porttracker
|
1420 |
# nfsen unit for systemd
|
1420 |
# nfsen unit for systemd
|
1421 |
cat << EOF > /lib/systemd/system/nfsen.service
|
1421 |
cat << EOF > /lib/systemd/system/nfsen.service
|
1422 |
# This file is part of systemd.
|
1422 |
# This file is part of systemd.
|