Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 1393 2014-06-19 08:44:51Z richard $
|
2 |
# $Id: alcasar.sh 1394 2014-06-19 11:25:57Z 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 1253... |
Line 1253... |
1253 |
## Function "nfsen" ##
|
1253 |
## Function "nfsen" ##
|
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 |
# Create a specific user and group
|
- |
|
1259 |
[ `grep "^apache:" /etc/group | wc -l` == 1 ] || groupadd apache
|
- |
|
1260 |
#[ `grep "^nfsen:" /etc/passwd | wc -l` == 1 ] || useradd -r -g nfsen -s /bin/false -c "system user for the grapher nfsen" nfsen
|
- |
|
1261 |
groupadd -f chilli
|
- |
|
1262 |
# Add PortTracker plugin
|
1258 |
# Add PortTracker plugin
|
1263 |
mkdir -p /var/www/nfsen/plugins /var/log/netflow/porttracker /usr/share/nfsen/plugins
|
1259 |
mkdir -p /var/www/nfsen/plugins /var/log/netflow/porttracker /usr/share/nfsen/plugins
|
1264 |
chown -R apache:apache /var/www/nfsen
|
1260 |
chown -R apache:apache /var/www/nfsen
|
1265 |
chown -R apache:apache /usr/share/nfsen
|
1261 |
chown -R apache:apache /usr/share/nfsen
|
1266 |
chown -R apache:apache /var/log/netflow
|
1262 |
chown -R apache:apache /var/log/netflow
|
Line 1273... |
Line 1269... |
1273 |
/usr/bin/perl5 install.pl etc/nfsen.conf
|
1269 |
/usr/bin/perl5 install.pl etc/nfsen.conf
|
1274 |
/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"
|
1275 |
# 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)
|
1276 |
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/
|
1277 |
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/
|
1278 |
[ -d /var/log/netflow/porttracker ] || sudo -u apache nftrack -I -d /var/log/netflow/porttracker
|
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
|
1279 |
chown -R apache:apache /var/log/netflow/porttracker/
|
1275 |
chown -R apache:apache /var/log/netflow/porttracker/
|
1280 |
chmod -R 775 /var/log/netflow/porttracker
|
1276 |
chmod -R 775 /var/log/netflow/porttracker
|
1281 |
# Apache conf file
|
1277 |
# Apache conf file
|
1282 |
rm -f /etc/httpd/conf/conf.d/nfsen.conf
|
- |
|
1283 |
cat <<EOF >> /etc/httpd/conf/conf.d/nfsen.conf
|
1278 |
cat << EOF > /etc/httpd/conf/conf.d/nfsen.conf
|
1284 |
Alias /nfsen /var/www/nfsen
|
1279 |
Alias /nfsen /var/www/nfsen
|
1285 |
<Directory /var/www/nfsen/>
|
1280 |
<Directory /var/www/nfsen/>
|
1286 |
DirectoryIndex nfsen.php
|
1281 |
DirectoryIndex nfsen.php
|
1287 |
Options -Indexes
|
1282 |
Options -Indexes
|
1288 |
AllowOverride all
|
1283 |
AllowOverride all
|