Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 1940 2016-06-12 22:09:49Z richard $
|
2 |
# $Id: alcasar.sh 1945 2016-06-14 21:34:14Z richard $
|
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 1695... |
Line 1695... |
1695 |
cat << EOF > /etc/cron.d/alcasar-distrib-updates
|
1695 |
cat << EOF > /etc/cron.d/alcasar-distrib-updates
|
1696 |
# mise à jour automatique de la distribution tous les jours 3h30
|
1696 |
# mise à jour automatique de la distribution tous les jours 3h30
|
1697 |
30 3 * * * root /usr/sbin/urpmi --auto-update --auto 2>&1
|
1697 |
30 3 * * * root /usr/sbin/urpmi --auto-update --auto 2>&1
|
1698 |
EOF
|
1698 |
EOF
|
1699 |
|
1699 |
|
- |
|
1700 |
cat << EOF > /etc/cron.d/alcasar-connections-stats
|
1700 |
# Connection stats update (accounting). These Perl scripts are from "dialup_admin" (cf. wiki.freeradius.org/Dialup_admin).
|
1701 |
# Connection stats update (accounting). These Perl scripts are from "dialup_admin" (cf. wiki.freeradius.org/Dialup_admin).
|
1701 |
# 'alcasar-tot_stats' (everyday at 01h01 pm) : aggregating the daily connections of users (write in the table 'totacct')
|
1702 |
# 'alcasar-tot_stats' (everyday at 01h01 pm) : aggregating the daily connections of users (write in the table 'totacct')
|
1702 |
# 'alcasar-monthly_tot_stat' (everyday at 01h05 pm) : aggregating the monthly connections of users (write in table 'mtotacct')
|
1703 |
# 'alcasar-monthly_tot_stat' (everyday at 01h05 pm) : aggregating the monthly connections of users (write in table 'mtotacct')
|
1703 |
# 'alcasar-truncate_raddact' (every month, the first at 01h10 pm) : removing the log sessions of users older than 365 days
|
1704 |
# 'alcasar-truncate_raddact' (every month, the first at 01h10 pm) : removing the log sessions of users older than 365 days
|
1704 |
# 'alcasar-clean_radacct' (every month, the first at 01h15 pm) : closing the sessions openned for more than 30 days
|
1705 |
# 'alcasar-clean_radacct' (every month, the first at 01h15 pm) : closing the sessions openned for more than 30 days
|
1705 |
cat << EOF > /etc/cron.d/alcasar-connections-stats
|
- |
|
1706 |
1 1 * * * root $DIR_DEST_BIN/alcasar-tot_stats > /dev/null 2>&1
|
1706 |
1 1 * * * root $DIR_DEST_BIN/alcasar-tot_stats > /dev/null 2>&1
|
1707 |
5 1 * * * root $DIR_DEST_BIN/alcasar-monthly_tot_stats > /dev/null 2>&1
|
1707 |
5 1 * * * root $DIR_DEST_BIN/alcasar-monthly_tot_stats > /dev/null 2>&1
|
1708 |
10 1 1 * * root $DIR_DEST_BIN/alcasar-truncate_radacct > /dev/null 2>&1
|
1708 |
10 1 1 * * root $DIR_DEST_BIN/alcasar-truncate_radacct > /dev/null 2>&1
|
1709 |
15 1 1 * * root $DIR_DEST_BIN/alcasar-clean_radacct > /dev/null 2>&1
|
1709 |
15 1 1 * * root $DIR_DEST_BIN/alcasar-clean_radacct > /dev/null 2>&1
|
1710 |
EOF
|
1710 |
EOF
|
1711 |
cat << EOF > /etc/cron.d/alcasar-watchdog
|
1711 |
cat << EOF > /etc/cron.d/alcasar-watchdog
|
1712 |
# activation du "chien de garde" (watchdog) toutes les 3'
|
1712 |
# run the "watchdog" every 3'
|
- |
|
1713 |
# empty the IPSET of the whitelisted IP (loaded dynamically with dnsmasq-whitelist) when every whitelisted users are logged out (every sunday at 0h05
|
1713 |
*/3 * * * * root $DIR_DEST_BIN/alcasar-watchdog.sh > /dev/null 2>&1
|
1714 |
*/3 * * * * root $DIR_DEST_BIN/alcasar-watchdog.sh > /dev/null 2>&1
|
1714 |
0 5 * * 0 root $DIR_DEST_BIN/alcasar-flush_ipset_wl.sh > /dev/null 2>&1
|
1715 |
0 5 * * 0 root $DIR_DEST_BIN/alcasar-flush_ipset_wl.sh > /dev/null 2>&1
|
1715 |
EOF
|
1716 |
EOF
|
1716 |
# Enabling the watchdog every 18'
|
1717 |
# Enabling the watchdog every 18'
|
1717 |
cat << EOF > /etc/cron.d/alcasar-daemon-watchdog
|
1718 |
cat << EOF > /etc/cron.d/alcasar-daemon-watchdog
|
1718 |
# activation du "chien de garde" (daemon-watchdog) à chaque redémarrage
|
1719 |
# activate the daemon-watchdog after boot process
|
1719 |
@reboot root $DIR_DEST_BIN/alcasar-daemon.sh > /dev/null 2>&1
|
1720 |
@reboot root $DIR_DEST_BIN/alcasar-daemon.sh > /dev/null 2>&1
|
1720 |
# activation du "chien de garde" (daemon-watchdog) toutes les 18'
|
1721 |
# activate the daemon-watchdog every 18'
|
1721 |
*/18 * * * * root $DIR_DEST_BIN/alcasar-daemon.sh > /dev/null 2>&1
|
1722 |
*/18 * * * * root $DIR_DEST_BIN/alcasar-daemon.sh > /dev/null 2>&1
|
1722 |
EOF
|
1723 |
EOF
|
1723 |
|
1724 |
|
1724 |
# Enabling category update from rsync
|
1725 |
# Enabling category update from rsync
|
1725 |
cat << EOF > /etc/cron.d/alcasar-rsync_bl
|
1726 |
cat << EOF > /etc/cron.d/alcasar-rsync_bl
|
1726 |
# Automatic update of BL via rsync. The categories are listed in the file '/usr/local/etc/update_cat.conf' (no sync if empty).
|
1727 |
# Automatic update of BL via rsync every 12 hours. The categories are listed in the file '/usr/local/etc/update_cat.conf' (no sync if empty).
|
1727 |
0 */12 * * * root $DIR_DEST_BIN/alcasar-bl.sh --update_cat > /dev/null 2>&1
|
1728 |
0 */12 * * * root $DIR_DEST_BIN/alcasar-bl.sh --update_cat > /dev/null 2>&1
|
1728 |
EOF
|
1729 |
EOF
|
1729 |
|
1730 |
|
1730 |
# removing the users crons
|
1731 |
# removing the users crons
|
1731 |
rm -f /var/spool/cron/*
|
1732 |
rm -f /var/spool/cron/*
|