Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 1569 2015-02-13 20:08:56Z richard $
|
2 |
# $Id: alcasar.sh 1570 2015-02-13 22:42:09Z 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 1405... |
Line 1405... |
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.7/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.7/etc/
|
1409 |
cp $DIR_CONF/nfsen/nfsen.conf /tmp/nfsen-1.3.7/etc/
|
1410 |
# Installation of nfsen
|
1410 |
# Installation of nfsen (we change a little 'install.pl in order not to ask the user for the perl version)
|
1411 |
DirTmp=$(pwd)
|
1411 |
DirTmp=$(pwd)
|
1412 |
cd /tmp/nfsen-1.3.7/
|
1412 |
cd /tmp/nfsen-1.3.7/
|
1413 |
/usr/bin/perl5 install.pl etc/nfsen.conf
|
1413 |
/usr/bin/perl install.pl etc/nfsen.conf
|
1414 |
/usr/bin/perl5 install.pl etc/nfsen.conf # to avoid a Perl mistake "Semaphore introuvable"
|
1414 |
/usr/bin/perl 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.7/contrib/PortTracker/PortTracker.pm /usr/share/nfsen/plugins/
|
1416 |
cp contrib/PortTracker/PortTracker.pm /usr/share/nfsen/plugins/
|
1417 |
cp /tmp/nfsen-1.3.7/contrib/PortTracker/PortTracker.php /var/www/html/acc/manager/nfsen/plugins/
|
1417 |
cp 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.
|