Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 2588 2018-08-14 10:54:21Z rexy $
|
2 |
# $Id: alcasar.sh 2589 2018-08-14 21:15:56Z rexy $
|
3 |
|
3 |
|
4 |
# alcasar.sh
|
4 |
# alcasar.sh
|
5 |
# ALCASAR is a Free and open source NAC created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
|
5 |
# ALCASAR is a Free and open source NAC created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
7 |
# team@alcasar.net
|
7 |
# team@alcasar.net
|
Line 1495... |
Line 1495... |
1495 |
## - Initialization of Vnstat and vnstat phpFrontEnd ##
|
1495 |
## - Initialization of Vnstat and vnstat phpFrontEnd ##
|
1496 |
###########################################################
|
1496 |
###########################################################
|
1497 |
vnstat ()
|
1497 |
vnstat ()
|
1498 |
{
|
1498 |
{
|
1499 |
[ -e /etc/vnstat.conf.default ] || cp /etc/vnstat.conf /etc/vnstat.conf.default
|
1499 |
[ -e /etc/vnstat.conf.default ] || cp /etc/vnstat.conf /etc/vnstat.conf.default
|
1500 |
$SED "s?Interface.*?Interface \"$EXTIF\"?g" /etc/vnstat.conf
|
1500 |
$SED "s?^Interface.*?Interface \"$EXTIF\"?g" /etc/vnstat.conf
|
- |
|
1501 |
$SED "s?^DatabaseDir.*?DatabaseDir /var/log/vnstat?g" /etc/vnstat.conf
|
1501 |
[ -e $DIR_ACC/manager/stats/config.php.default ] || cp $DIR_ACC/manager/stats/config.php $DIR_ACC/manager/stats/config.php.default
|
1502 |
[ -e $DIR_ACC/manager/stats/config.php.default ] || cp $DIR_ACC/manager/stats/config.php $DIR_ACC/manager/stats/config.php.default
|
1502 |
$SED "s?\$iface_list =.*?\$iface_list = array('$EXTIF');?" $DIR_ACC/manager/stats/config.php
|
1503 |
$SED "s?\$iface_list =.*?\$iface_list = array('$EXTIF');?" $DIR_ACC/manager/stats/config.php
|
1503 |
$SED "s?\$iface_title\['.*?\$iface_title\['$EXTIF'\] = \$title;?" $DIR_ACC/manager/stats/config.php
|
1504 |
$SED "s?\$iface_title\['.*?\$iface_title\['$EXTIF'\] = \$title;?" $DIR_ACC/manager/stats/config.php
|
1504 |
/usr/bin/vnstat -u -i $EXTIF
|
1505 |
/usr/bin/vnstat -i $EXTIF -u --force
|
1505 |
} # End of vnstat
|
1506 |
} # End of vnstat
|
1506 |
|
1507 |
|
1507 |
##################################################################
|
1508 |
##################################################################
|
1508 |
## Function "dnsmasq" ##
|
1509 |
## Function "dnsmasq" ##
|
1509 |
## - creation of the conf files of the 4 intances of dnsmasq ##
|
1510 |
## - creation of the conf files of the 4 intances of dnsmasq ##
|