Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2423 → Rev 2422

/alcasar.sh
1061,12 → 1061,12
/usr/bin/systemctl daemon-reload
} # End of init_db ()
 
###################################################################
## Function "freeradius" ##
## - Set the configuration files ##
## - Set the shared secret between coova-chilli and freeradius ##
## - Adapt the Mysql conf file and counters ##
###################################################################
##########################################################################
## Fonction "freeradius" ##
## - Paramètrage des fichiers de configuration FreeRadius ##
## - Affectation du secret partagé entre coova-chilli et freeradius ##
## - Modification de fichier de conf pour l'accès à Mysql ##
##########################################################################
freeradius ()
{
cp -f $DIR_CONF/empty-radiusd-db.sql /etc/raddb/
1084,9 → 1084,10
cat << EOF > /etc/raddb/clients.conf
client 127.0.0.1 {
secret = $secretradius
shortname = coova
shortname = localhost
}
EOF
 
# Set Virtual server (remvove all except "alcasar virtual site")
rm -f /etc/raddb/sites-enabled/*
cp $DIR_CONF/radius/alcasar-radius /etc/raddb/sites-available/alcasar
1102,15 → 1103,23
do
ln -s /etc/raddb/mods-available/$mods /etc/raddb/mods-enabled/$mods
done
# Configure SQL mod
# Configure SQL mod (TODO :and SQL counter)
[ -e /etc/raddb/mods-available/sql.default ] || cp /etc/raddb/mods-available/sql /etc/raddb/mods-available/sql.default
$SED "s?^[\t ]*driver =.*?driver = \"rlm_sql_mysql\"?g" /etc/raddb/mods-available/sql
$SED "s?^[\t ]*dialect =.*?dialect = \"mysql\"?g" /etc/raddb/mods-available/sql
cp $DIR_CONF/radius/sql /etc/raddb/mods-available/sql
chown radius:radius /etc/raddb/mods-available/sql
$SED "s?^[\t ]*login =.*?login = \"$DB_USER\"?g" /etc/raddb/mods-available/sql
$SED "s?^[\t ]*password =.*?password = \"$radiuspwd\"?g" /etc/raddb/mods-available/sql
$SED "s?^[\t ]*radius_db =.*?radius_db = \"$DB_RADIUS\"?g" /etc/raddb/mods-available/sql
$SED "s?^#[\t ]*server =.*?server = \"localhost\"?g" /etc/raddb/mods-available/sql
$SED "s?^#[\t ]*port =.*?port = \"3306\"?g" /etc/raddb/mods-available/sql
$SED "s?^#[\t ]*login =.*?login = \"$DB_USER\"?g" /etc/raddb/mods-available/sql
$SED "s?^#[\t ]*password =.*?password = \"$radiuspwd\"?g" /etc/raddb/mods-available/sql
 
# $SED "s?^[\t ]*#[\t ]*\$INCLUDE sql/mysql/counter.conf?\$INCLUDE sql/mysql/counter.conf?g" /etc/raddb/radiusd.conf
# $SED "s?^[\t ]*\$INCLUDE policy.conf?#\$INCLUDE policy.conf?g" /etc/raddb/radiusd.conf
# $SED "s?^[\t ]*\$INCLUDE \${confdir}/modules/.*?\t#\$INCLUDE \${confdir}/modules/\n\t# we only include modules for ALCASAR needs\n\t\$INCLUDE \${confdir}/modules/attr_filter\n\t\$INCLUDE \${confdir}/modules/expiration\n\t\$INCLUDE \${confdir}/modules/logintime\n\t\$INCLUDE \${confdir}/modules/ldap\n\t\$INCLUDE \${confdir}/modules/pap?g" /etc/raddb/radiusd.conf
# $SED "s/^[\t ]exec$/\#\texec/g" /etc/raddb/radiusd.conf
# $SED "s?^[\t ]*expr.*?\#\texpr?g" /etc/raddb/radiusd.conf
# $SED "s?^[\t ]*\# daily.*?\#\tdaily\n\tsql?g" /etc/raddb/radiusd.conf
# $SED "s?^[\t ]*logintime.*?\tlogintime\n\tnoresetcounter\n\tdailycounter\n\tmonthlycounter\n\tattr_filter.access_reject\n\tattr_filter.accounting_response\n\tpap?g" /etc/raddb/radiusd.conf
# $SED "s?^[\t ]*\$INCLUDE sites-enabled/.*?\#\$INCLUDE sites-enabled/\n\#\tenable only alcasar virtual server\n\$INCLUDE sites-enabled/alcasar?g" /etc/raddb/radiusd.conf
 
# queries.conf modifications : case sensitive for username, check simultaneous use, patch on 'postauth' table, etc.
[ -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
cp -f $DIR_CONF/radius/queries.conf /etc/raddb/mods-config/sql/main/mysql/queries.conf
1151,11 → 1160,11
} # End freeradius ()
 
#############################################################################
## Fonction "chilli" ##
## - Creation of the conf file and init file (systemd) for coova-chilli ##
## - Adapt the authentication web page (intercept.php) ##
#############################################################################
##################################################################################
## Fonction "chilli" ##
## - Création du fichier d'initialisation et de configuration de coova-chilli ##
## - Paramètrage de la page d'authentification (intercept.php) ##
##################################################################################
chilli ()
{
# chilli unit for systemd