Subversion Repositories ALCASAR

Rev

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

Rev 3170 Rev 3177
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 3170 2024-02-22 17:28:40Z rexy $
2
#  $Id: alcasar.sh 3177 2024-03-01 18:32:19Z rexy $
3
 
3
 
4
# ALCASAR is a Free and open source NAC (Network Access Controler) created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
4
# ALCASAR is a Free and open source NAC (Network Access Controler) created by Franck BOUIJOUX (3abtux), Pascal LEVANT and Richard REY (Rexy)
5
# ALCASAR is based on a stripped Mageia (LSB) with the following open source softwares Coovachilli, freeradius, mariaDB, lighttpd, php, netfilter, e2guardian, ntpd, openssl, unbound, gammu, Ulog, fail2ban, vnstat, wkhtml2pdf, ipt_NETFLOW, NFsen and NFdump
5
# ALCASAR is based on a stripped Mageia (LSB) with the following open source softwares Coovachilli, freeradius, mariaDB, lighttpd, php, netfilter, e2guardian, ntpd, openssl, unbound, gammu, Ulog, fail2ban, vnstat, wkhtml2pdf, ipt_NETFLOW, NFsen and NFdump
6
# contact : info@alcasar.net
6
# contact : info@alcasar.net
7
 
7
 
Line 1281... Line 1281...
1281
e2guardian()
1281
e2guardian()
1282
{
1282
{
1283
# Adapt systemd unit
1283
# Adapt systemd unit
1284
	cp /lib/systemd/system/e2guardian.service /etc/systemd/system/e2guardian.service
1284
	cp /lib/systemd/system/e2guardian.service /etc/systemd/system/e2guardian.service
1285
	$SED "s?^ExecStart=.*?ExecStart=/usr/sbin/e2guardian -c /etc/e2guardian/e2guardian.conf?g" /etc/systemd/system/e2guardian.service
1285
	$SED "s?^ExecStart=.*?ExecStart=/usr/sbin/e2guardian -c /etc/e2guardian/e2guardian.conf?g" /etc/systemd/system/e2guardian.service
1286
	$SED "s?^After=.*?After=network.target chilli.service?g" /etc/systemd/system/e2guardian.service
1286
	$SED "s?^After=.*?After=network-online.target chilli.service?g" /etc/systemd/system/e2guardian.service
-
 
1287
	$SED "/^PIDFile=/d" /etc/systemd/system/e2guardian.service
-
 
1288
 
1287
# Adapt the main conf file
1289
# Adapt the main conf file
1288
	[ -e $DIR_DG/e2guardian.conf.default ] || cp $DIR_DG/e2guardian.conf $DIR_DG/e2guardian.conf.default
1290
	[ -e $DIR_DG/e2guardian.conf.default ] || cp $DIR_DG/e2guardian.conf $DIR_DG/e2guardian.conf.default
1289
# French deny HTML page
1291
# French deny HTML page
1290
	$SED "s?^language =.*?language = 'french'?g" $DIR_DG/e2guardian.conf
1292
	$SED "s?^language =.*?language = 'french'?g" $DIR_DG/e2guardian.conf
1291
# 2 filtergroups (8080 & 8090)
1293
# 2 filtergroups (8080 & 8090)
Line 1638... Line 1640...
1638
	include: /etc/unbound/conf.d/blackhole/*
1640
	include: /etc/unbound/conf.d/blackhole/*
1639
EOF
1641
EOF
1640
	cp /lib/systemd/system/unbound.service /etc/systemd/system/unbound.service
1642
	cp /lib/systemd/system/unbound.service /etc/systemd/system/unbound.service
1641
	$SED "s?^ExecStart=.*?ExecStart=/usr/sbin/unbound -d -c /etc/unbound/unbound.conf?g" /etc/systemd/system/unbound.service
1643
	$SED "s?^ExecStart=.*?ExecStart=/usr/sbin/unbound -d -c /etc/unbound/unbound.conf?g" /etc/systemd/system/unbound.service
1642
	$SED "s?^After=.*?After=syslog.target network-online.target chilli.service?g" /etc/systemd/system/unbound.service
1644
	$SED "s?^After=.*?After=syslog.target network-online.target chilli.service?g" /etc/systemd/system/unbound.service
-
 
1645
	$SED "/^PIDFile=/d" /etc/systemd/system/unbound.service
1643
	for list in blacklist blackhole whitelist
1646
	for list in blacklist blackhole whitelist
1644
	do
1647
	do
1645
		cp -f /lib/systemd/system/unbound.service /etc/systemd/system/unbound-$list.service
1648
		cp -f /etc/systemd/system/unbound.service /etc/systemd/system/unbound-$list.service
1646
		$SED "s?^ExecStart=.*?ExecStart=/usr/sbin/unbound -d -c /etc/unbound/unbound-$list.conf?g" /etc/systemd/system/unbound-$list.service
1649
		$SED "s?^ExecStart=.*?ExecStart=/usr/sbin/unbound -d -c /etc/unbound/unbound-$list.conf?g" /etc/systemd/system/unbound-$list.service
1647
		$SED "s?^PIDFile=.*?PIDFile=/run/unbound-$list.pid?g" /etc/systemd/system/unbound-$list.service
-
 
1648
	done
1650
	done
1649
	$SED "s?^After=.*?After=syslog.target network-online.target chilli.service?g" /etc/systemd/system/unbound-whitelist.service
-
 
1650
} # End of unbound()
1651
} # End of unbound()
1651
 
1652
 
1652
##################################################
1653
##################################################
1653
##                   "dhcpd"                    ##
1654
##                   "dhcpd"                    ##
1654
##################################################
1655
##################################################