Subversion Repositories ALCASAR

Rev

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

Rev 2006 Rev 2009
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2006 2016-07-22 13:07:10Z raphael.pion $ 
2
#  $Id: alcasar.sh 2009 2016-07-25 15:31:27Z raphael.pion $ 
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
 
5
 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
7
# Ce programme est un logiciel libre ; This software is free and open source
7
# Ce programme est un logiciel libre ; This software is free and open source
Line 1550... Line 1550...
1550
cache-size=2048
1550
cache-size=2048
1551
domain-needed
1551
domain-needed
1552
expand-hosts
1552
expand-hosts
1553
bogus-priv
1553
bogus-priv
1554
filterwin2k
1554
filterwin2k
-
 
1555
log-queries
-
 
1556
log-facility=/var/log/dnsmasq/dnsmasq-blacklist.log
1555
server=$DNS1
1557
server=$DNS1
1556
server=$DNS2
1558
server=$DNS2
1557
EOF
1559
EOF
1558
# 3rd dnsmasq listen on udp 55 ("dnsmasq with whitelist")
1560
# 3rd dnsmasq listen on udp 55 ("dnsmasq with whitelist")
1559
	cat << EOF > /etc/dnsmasq-whitelist.conf
1561
	cat << EOF > /etc/dnsmasq-whitelist.conf
Line 1716... Line 1718...
1716
# Connection stats update (accounting). These Perl scripts are from "dialup_admin" (cf. wiki.freeradius.org/Dialup_admin).
1718
# Connection stats update (accounting). These Perl scripts are from "dialup_admin" (cf. wiki.freeradius.org/Dialup_admin).
1717
# 'alcasar-tot_stats' (everyday at 01h01 pm) : aggregating the daily connections of users (write in the table 'totacct')
1719
# 'alcasar-tot_stats' (everyday at 01h01 pm) : aggregating the daily connections of users (write in the table 'totacct')
1718
# 'alcasar-monthly_tot_stat' (everyday at 01h05 pm) : aggregating the monthly connections of users (write in table 'mtotacct')
1720
# 'alcasar-monthly_tot_stat' (everyday at 01h05 pm) : aggregating the monthly connections of users (write in table 'mtotacct')
1719
# 'alcasar-truncate_raddact' (every month, the first at 01h10 pm) : removing the log sessions of users older than 365 days
1721
# 'alcasar-truncate_raddact' (every month, the first at 01h10 pm) : removing the log sessions of users older than 365 days
1720
# 'alcasar-clean_radacct' (every month, the first at 01h15 pm) : closing the sessions openned for more than 30 days
1722
# 'alcasar-clean_radacct' (every month, the first at 01h15 pm) : closing the sessions openned for more than 30 days
-
 
1723
# 'alcasar-activity_report.sh' (every sunday at 5h35 pm) : generate an activity report in PDF
1721
1 1 * * * root $DIR_DEST_BIN/alcasar-tot_stats > /dev/null 2>&1
1724
1 1 * * * root $DIR_DEST_BIN/alcasar-tot_stats > /dev/null 2>&1
1722
5 1 * * * root $DIR_DEST_BIN/alcasar-monthly_tot_stats > /dev/null 2>&1
1725
5 1 * * * root $DIR_DEST_BIN/alcasar-monthly_tot_stats > /dev/null 2>&1
1723
10 1 1 * * root $DIR_DEST_BIN/alcasar-truncate_radacct > /dev/null 2>&1
1726
10 1 1 * * root $DIR_DEST_BIN/alcasar-truncate_radacct > /dev/null 2>&1
1724
15 1 1 * * root $DIR_DEST_BIN/alcasar-clean_radacct > /dev/null 2>&1
1727
15 1 1 * * root $DIR_DEST_BIN/alcasar-clean_radacct > /dev/null 2>&1
-
 
1728
35 5 * * 0 root $DIR_DEST_BIN/alcasar-activity_report.sh > /dev/null 2>&1
1725
EOF
1729
EOF
1726
	cat << EOF > /etc/cron.d/alcasar-watchdog
1730
	cat << EOF > /etc/cron.d/alcasar-watchdog
1727
# run the "watchdog" every 3'
1731
# run the "watchdog" every 3'
1728
# empty the IPSET of the whitelisted IP (loaded dynamically with dnsmasq-whitelist) when every whitelisted users are logged out (every sunday at 0h05
1732
# empty the IPSET of the whitelisted IP (loaded dynamically with dnsmasq-whitelist) when every whitelisted users are logged out (every sunday at 0h05
1729
*/3 * * * * root $DIR_DEST_BIN/alcasar-watchdog.sh > /dev/null 2>&1
1733
*/3 * * * * root $DIR_DEST_BIN/alcasar-watchdog.sh > /dev/null 2>&1