Subversion Repositories ALCASAR

Rev

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

Rev 2926 Rev 2933
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2926 2021-02-26 23:26:26Z rexy $
2
#  $Id: alcasar.sh 2933 2021-03-27 10:17:40Z 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 1470... Line 1470...
1470
##                     Function "vnstat"                 ##
1470
##                     Function "vnstat"                 ##
1471
## - Initialization of vnstat and vnstat-dashboard       ##
1471
## - Initialization of vnstat and vnstat-dashboard       ##
1472
###########################################################
1472
###########################################################
1473
vnstat()
1473
vnstat()
1474
{
1474
{
1475
    # vnstat
1475
	# vnstat
1476
    [ -e /etc/vnstat.conf.default ] || cp /etc/vnstat.conf /etc/vnstat.conf.default
1476
	[ -e /etc/vnstat.conf.default ] || cp /etc/vnstat.conf /etc/vnstat.conf.default
1477
	$SED "s?^Interface.*?Interface \"$EXTIF\"?g" /etc/vnstat.conf
1477
	$SED "s?^Interface.*?Interface \"$EXTIF\"?g" /etc/vnstat.conf
1478
	$SED "s?^DatabaseDir.*?DatabaseDir /var/log/vnstat?g" /etc/vnstat.conf
1478
	$SED "s?^DatabaseDir.*?DatabaseDir /var/log/vnstat?g" /etc/vnstat.conf
-
 
1479
	$SED "s?^MaxBandwidth.*?MaxBandwidth 10000?g" /etc/vnstat.conf
1479
    # vnstat-dashboard
1480
	# vnstat-dashboard
1480
    $SED "s?^\$thisInterface.*?\$thisInterface = \"$EXTIF\";?" $DIR_ACC/manager/vnstat/index.php
1481
	$SED "s?^\$thisInterface.*?\$thisInterface = \"$EXTIF\";?" $DIR_ACC/manager/vnstat/index.php
1481
	[ -e /lib/systemd/system/vnstat.service.default ] || cp /lib/systemd/system/vnstat.service /lib/systemd/system/vnstat.service.default
1482
	[ -e /lib/systemd/system/vnstat.service.default ] || cp /lib/systemd/system/vnstat.service /lib/systemd/system/vnstat.service.default
1482
    $SED "s?^PIDFILE=.*?PIDFILE=/run/vnstat/vnstat.pid?g" /lib/systemd/system/vnstat.service
1483
	$SED "s?^PIDFILE=.*?PIDFILE=/run/vnstat/vnstat.pid?g" /lib/systemd/system/vnstat.service
1483
} # End of vnstat()
1484
} # End of vnstat()
1484
 
1485
 
1485
###################################################################
1486
###################################################################
1486
##                     Function "dnsmasq"                        ##
1487
##                     Function "dnsmasq"                        ##
1487
## - creation of the conf files of dnsmasq (whitelist for ipset )##
1488
## - creation of the conf files of dnsmasq (whitelist for ipset )##