Subversion Repositories ALCASAR

Rev

Rev 3197 | Rev 3201 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 3197 Rev 3200
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 3197 2024-04-24 17:43:09Z rexy $
2
#  $Id: alcasar.sh 3200 2024-05-05 22:45:25Z 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
 
1281
 
1282
# Adapt the main conf file
1282
# Adapt the main conf file
1283
	[ -e $DIR_E2G/e2guardian.conf.default ] || cp $DIR_E2G/e2guardian.conf $DIR_E2G/e2guardian.conf.default
1283
	[ -e $DIR_E2G/e2guardian.conf.default ] || cp $DIR_E2G/e2guardian.conf $DIR_E2G/e2guardian.conf.default
1284
# French deny HTML page
1284
# French deny HTML page
1285
	$SED "s?^language =.*?language = 'french'?g" $DIR_E2G/e2guardian.conf
1285
	$SED "s?^language =.*?language = 'french'?g" $DIR_E2G/e2guardian.conf
1286
# +++ listen & loop prevention on loopback
1286
# Listen & loop prevention on loopback
1287
	$SED "s?^#checkip = 127.0.0.1.*?checkip = 127.0.0.1?g" $DIR_E2G/e2guardian.conf
1287
	$SED "s?^#checkip = 127.0.0.1.*?checkip = 127.0.0.1?g" $DIR_E2G/e2guardian.conf
1288
# 2 filtergroups (8080 & 8090)
1288
# 2 filtergroups (8080 & 8090)
1289
	$SED "s?^#filtergroups =.*?filtergroups = 2?g" $DIR_E2G/e2guardian.conf
1289
	$SED "s?^#filtergroups =.*?filtergroups = 2?g" $DIR_E2G/e2guardian.conf
1290
# Listen on LAN only
1290
# Listen on LAN only
1291
	$SED "s?^#filterip =.*?filterip = $PRIVATE_IP?g" $DIR_E2G/e2guardian.conf
1291
	$SED "s?^#filterip =.*?filterip = $PRIVATE_IP?g" $DIR_E2G/e2guardian.conf
Line 1315... Line 1315...
1315
	$SED "s?\/\/[a-z.]*\/?\/\/$HOSTNAME.$DOMAIN\/?g" /usr/share/e2guardian/languages/ukenglish/alcasar-e2g.html
1315
	$SED "s?\/\/[a-z.]*\/?\/\/$HOSTNAME.$DOMAIN\/?g" /usr/share/e2guardian/languages/ukenglish/alcasar-e2g.html
1316
 
1316
 
1317
###### ALCASAR filtering for group1 (blacklisted_users) ####
1317
###### ALCASAR filtering for group1 (blacklisted_users) ####
1318
# Adapt group1 conf file
1318
# Adapt group1 conf file
1319
	[ -e $DIR_E2G/e2guardianf1.conf.default ] || cp $DIR_E2G/e2guardianf1.conf $DIR_E2G/e2guardianf1.conf.default
1319
	[ -e $DIR_E2G/e2guardianf1.conf.default ] || cp $DIR_E2G/e2guardianf1.conf $DIR_E2G/e2guardianf1.conf.default
1320
	$SED "s/^#reportinglevel =.*/reportinglevel = 3/g" $DIR_E2G/e2guardianf1.conf
1320
	$SED "s?^#reportinglevel =.*?reportinglevel = 3?g" $DIR_E2G/e2guardianf1.conf
1321
	$SED "s/^#groupname =.*/groupname = 'blacklisted_users'/g" $DIR_E2G/e2guardianf1.conf
1321
	$SED "s?^#groupname =.*?groupname = 'blacklisted_users'?g" $DIR_E2G/e2guardianf1.conf
1322
	$SED "s/^#htmltemplate =.*/htmltemplate = 'alcasar-e2g.html'/g" $DIR_E2G/e2guardianf1.conf
1322
	$SED "s?^#htmltemplate =.*?htmltemplate = 'alcasar-e2g.html'?g" $DIR_E2G/e2guardianf1.conf
1323
	$SED "s/^.Define LISTDIR.*/.Define LISTDIR <$DIR_E2G/lists/group1/g" $DIR_E2G/e2guardianf1.conf
1323
	$SED "s?^\.Define LISTDIR.*?\.Define LISTDIR <$DIR_E2G/lists/group1>?g" $DIR_E2G/e2guardianf1.conf
1324
	DIR_E2G_GROUP1="$DIR_E2G/lists/group1"
1324
	DIR_E2G_GROUP1="$DIR_E2G/lists/group1"
1325
	cp -r $DIR_E2G/lists/example.group $DIR_E2G_GROUP1
1325
	cp -r $DIR_E2G/lists/example.group $DIR_E2G_GROUP1
1326
	chown -R e2guardian:root $DIR_E2G_GROUP1
1326
	chown -R e2guardian:root $DIR_E2G_GROUP1
1327
# RAZ bannedphraselist
1327
# RAZ bannedphraselist
1328
	$SED "s?^[^#]?#&?g" $DIR_E2G_GROUP1/bannedphraselist # (comment what is not)
1328
	$SED "s?^[^#]?#&?g" $DIR_E2G_GROUP1/bannedphraselist # (comment what is not)