Subversion Repositories ALCASAR

Rev

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

Rev 2467 Rev 2470
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2467 2017-12-24 16:12:53Z richard $
2
#  $Id: alcasar.sh 2470 2017-12-27 18:46:44Z richard $
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 1138... Line 1138...
1138
# queries.conf modifications : case sensitive for username, check simultaneous use, patch on 'postauth' table, etc.
1138
# queries.conf modifications : case sensitive for username, check simultaneous use, patch on 'postauth' table, etc.
1139
	[ -e /etc/raddb/mods-config/sql/main/mysql/queries.conf.default ] || cp /etc/raddb/mods-config/sql/main/mysql/queries.conf /etc/raddb/mods-config/sql/main/mysql/queries.conf.default
1139
	[ -e /etc/raddb/mods-config/sql/main/mysql/queries.conf.default ] || cp /etc/raddb/mods-config/sql/main/mysql/queries.conf /etc/raddb/mods-config/sql/main/mysql/queries.conf.default
1140
	cp -f $DIR_CONF/radius/queries.conf /etc/raddb/mods-config/sql/main/mysql/queries.conf
1140
	cp -f $DIR_CONF/radius/queries.conf /etc/raddb/mods-config/sql/main/mysql/queries.conf
1141
	chown -R radius:radius /etc/raddb/mods-config/sql/main/mysql/queries.conf
1141
	chown -R radius:radius /etc/raddb/mods-config/sql/main/mysql/queries.conf
1142
# sqlcounter modifications
1142
# sqlcounter modifications
-
 
1143
	[ -e /etc/raddb/mods-available/sqlcounter.default ] || cp /etc/raddb/mods-available/sqlcounter /etc/raddb/mods-available/sqlcounter.default
-
 
1144
	cp -f $DIR_CONF/radius/sqlcounter /etc/raddb/mods-available/sqlcounter
-
 
1145
	chown -R radius:radius /etc/raddb/mods-available/sqlcounter
1143
	[ -e /etc/raddb/mods-config/sql/counter/mysql/dailycounter.conf.default ] || cp /etc/raddb/mods-config/sql/counter/mysql/dailycounter.conf /etc/raddb/mods-config/sql/counter/mysql/dailycounter.conf.default
1146
	[ -e /etc/raddb/mods-config/sql/counter/mysql/dailycounter.conf.default ] || cp /etc/raddb/mods-config/sql/counter/mysql/dailycounter.conf /etc/raddb/mods-config/sql/counter/mysql/dailycounter.conf.default
1144
	cat << EOF > /etc/raddb/mods-config/sql/counter/mysql/dailycounter.conf
1147
	cat << EOF > /etc/raddb/mods-config/sql/counter/mysql/dailycounter.conf
1145
query = "\
1148
query = "\
1146
    SELECT IFNULL((SELECT SUM(acctsessiontime - GREATEST((%%b - UNIX_TIMESTAMP(acctstarttime)),0)) \
1149
    SELECT IFNULL((SELECT SUM(acctsessiontime - GREATEST((%%b - UNIX_TIMESTAMP(acctstarttime)),0)) \
1147
    FROM radacct \
1150
    FROM radacct \