Subversion Repositories ALCASAR

Rev

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

Rev 2771 Rev 2772
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2771 2020-02-22 09:50:24Z rexy $
2
#  $Id: alcasar.sh 2772 2020-03-01 18:04:45Z 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 1488... Line 1488...
1488
## - configure NetFlow collector (nfcapd)               ##
1488
## - configure NetFlow collector (nfcapd)               ##
1489
## - configure NetFlow grapher (nfsen-ng)               ##
1489
## - configure NetFlow grapher (nfsen-ng)               ##
1490
##########################################################
1490
##########################################################
1491
nfsen()
1491
nfsen()
1492
{
1492
{
1493
    groupadd -f nfcapd
1493
	groupadd -f nfcapd
1494
	useradd -r -g nfcapd -s /bin/false -c "system user for nfcapd" nfcapd
1494
	useradd -r -g nfcapd -s /bin/false -c "system user for nfcapd" nfcapd
1495
# nfcapd unit for systemd
1495
# nfcapd unit for systemd
1496
	cat << EOF > /lib/systemd/system/nfcapd.service
1496
	cat << EOF > /lib/systemd/system/nfcapd.service
1497
#  This file is part of systemd.
1497
#  This file is part of systemd.
1498
#
1498
#
Line 1513... Line 1513...
1513
ExecReload=/bin/kill -HUP $MAINPID
1513
ExecReload=/bin/kill -HUP $MAINPID
1514
 
1514
 
1515
[Install]
1515
[Install]
1516
WantedBy=multi-user.target
1516
WantedBy=multi-user.target
1517
EOF
1517
EOF
1518
    [ -e /var/log/nfsen/profile-data/live/alcasar_netflow ] || mkdir -p /var/log/nfsen/profile-data/live/alcasar_netflow
1518
    [ -d /var/log/nfsen/profile-data/live/alcasar_netflow ] || mkdir -p /var/log/nfsen/profile-data/live/alcasar_netflow
1519
    [ -e /var/run/nfcapd ] || mkdir -p /var/run/nfcapd
1519
    [ -d /var/run/nfcapd ] || mkdir -p /var/run/nfcapd
1520
    chown -R nfcapd:nfcapd /var/log/nfsen/profile-data/live/alcasar_netflow /var/run/nfcapd
1520
    chown -R nfcapd:nfcapd /var/log/nfsen /var/run/nfcapd
1521
#    chown -R apache:apache /var/www/html/acc/manager/nfsen-ng
1521
#    chown -R apache:apache /var/log/nfsen/profile-data/live/alcasar_netflow
1522
} # End of nfsen()
1522
} # End of nfsen()
1523
 
1523
 
1524
###########################################################
1524
###########################################################
1525
##                     Function "vnstat"                 ##
1525
##                     Function "vnstat"                 ##
1526
## - Initialization of Vnstat and vnstat phpFrontEnd     ##
1526
## - Initialization of Vnstat and vnstat phpFrontEnd     ##
Line 2004... Line 2004...
2004
[Install]
2004
[Install]
2005
WantedBy=multi-user.target
2005
WantedBy=multi-user.target
2006
EOF
2006
EOF
2007
 
2007
 
2008
# Log folder for gammu-smsd
2008
# Log folder for gammu-smsd
2009
	[ -e /var/log/gammu-smsd ] || mkdir /var/log/gammu-smsd
2009
	[ -d /var/log/gammu-smsd ] || mkdir /var/log/gammu-smsd
2010
	chmod 755 /var/log/gammu-smsd
2010
	chmod 755 /var/log/gammu-smsd
2011
 
2011
 
2012
# Udev rule for Modeswitch (switch from "mass_storage" mode to "ttyUSB" modem) needed with some Huawei MODEM (idVendor: 12d1)
2012
# Udev rule for Modeswitch (switch from "mass_storage" mode to "ttyUSB" modem) needed with some Huawei MODEM (idVendor: 12d1)
2013
# normally not needed now since modeswitch is managed by udev (see Mageia RPM)
2013
# normally not needed now since modeswitch is managed by udev (see Mageia RPM)
2014
#cat << EOF > /lib/udev/rules.d/66-huawei.rules
2014
#cat << EOF > /lib/udev/rules.d/66-huawei.rules