Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 1828 2016-04-19 09:56:14Z richard $
|
2 |
# $Id: alcasar.sh 1832 2016-04-24 14:19:20Z 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 998... |
Line 998... |
998 |
/usr/bin/systemctl daemon-reload
|
998 |
/usr/bin/systemctl daemon-reload
|
999 |
} # End radius ()
|
999 |
} # End radius ()
|
1000 |
|
1000 |
|
1001 |
##########################################################################
|
1001 |
##########################################################################
|
1002 |
## Function "radius_web" ##
|
1002 |
## Function "radius_web" ##
|
1003 |
## - Import, modification et paramètrage de l'interface "dialupadmin" ##
|
1003 |
## - Import, modification et paramètrage de l'interface "freeradius-WEB ##
|
1004 |
## - Création du lien vers la page de changement de mot de passe ##
|
1004 |
## - Création du lien vers la page de changement de mot de passe ##
|
1005 |
##########################################################################
|
1005 |
##########################################################################
|
1006 |
radius_web ()
|
1006 |
radius_web ()
|
1007 |
{
|
1007 |
{
|
1008 |
# copie de l'interface d'origine dans la structure Alcasar
|
1008 |
# copy "freeradius-web" files and conf files in the manager arae of ACC
|
1009 |
#[ -d /usr/share/freeradius-web ] && cp -rf /usr/share/freeradius-web/* $DIR_ACC/manager/
|
- |
|
1010 |
#rm -f $DIR_ACC/manager/index.html $DIR_ACC/manager/readme
|
- |
|
1011 |
#rm -f $DIR_ACC/manager/htdocs/about.html $DIR_ACC/manager/htdocs/index.html $DIR_ACC/manager/htdocs/content.html
|
- |
|
1012 |
# copie des fichiers modifiés
|
- |
|
1013 |
cp -rf $DIR_INSTALL/web/acc/manager/* $DIR_ACC/manager/
|
1009 |
cp -rf $DIR_INSTALL/web/acc/manager/* $DIR_ACC/manager/
|
1014 |
cp -rf $DIR_CONF/freeradius-web/ /etc/
|
1010 |
cp -rf $DIR_CONF/freeradius-web/ /etc/
|
1015 |
chown -R apache:apache $DIR_ACC/manager/
|
1011 |
chown -R apache:apache $DIR_ACC/manager/
|
1016 |
# Modification des fichiers de configuration
|
1012 |
# adapt the main conf file to Alcasar behaviour
|
1017 |
[ -e /etc/freeradius-web/admin.conf.default ] || cp /etc/freeradius-web/admin.conf /etc/freeradius-web/admin.conf.default
|
1013 |
[ -e /etc/freeradius-web/admin.conf.default ] || cp /etc/freeradius-web/admin.conf /etc/freeradius-web/admin.conf.default
|
1018 |
$SED "s?^general_domain:.*?general_domain: $DOMAIN?g" /etc/freeradius-web/admin.conf
|
1014 |
$SED "s?^general_domain:.*?general_domain: $DOMAIN?g" /etc/freeradius-web/admin.conf
|
1019 |
$SED "s?^sql_username:.*?sql_username: $DB_USER?g" /etc/freeradius-web/admin.conf
|
1015 |
$SED "s?^sql_username:.*?sql_username: $DB_USER?g" /etc/freeradius-web/admin.conf
|
1020 |
$SED "s?^sql_password:.*?sql_password: $radiuspwd?g" /etc/freeradius-web/admin.conf
|
1016 |
$SED "s?^sql_password:.*?sql_password: $radiuspwd?g" /etc/freeradius-web/admin.conf
|
1021 |
$SED "s?^sql_debug:.*?sql_debug: false?g" /etc/freeradius-web/admin.conf
|
1017 |
$SED "s?^sql_debug:.*?sql_debug: false?g" /etc/freeradius-web/admin.conf
|
1022 |
$SED "s?^sql_usergroup_table: .*?sql_usergroup_table: radusergroup?g" /etc/freeradius-web/admin.conf
|
1018 |
$SED "s?^sql_usergroup_table: .*?sql_usergroup_table: radusergroup?g" /etc/freeradius-web/admin.conf
|
1023 |
$SED "s?^sql_password_attribute:.*?sql_password_attribute: Crypt-Password?g" /etc/freeradius-web/admin.conf
|
1019 |
$SED "s?^sql_password_attribute:.*?sql_password_attribute: Crypt-Password?g" /etc/freeradius-web/admin.conf
|
1024 |
$SED "s?^general_finger_type.*?# general_finger_type: snmp?g" /etc/freeradius-web/admin.conf
|
1020 |
$SED "s?^general_finger_type.*?# general_finger_type: snmp?g" /etc/freeradius-web/admin.conf
|
1025 |
$SED "s?^general_stats_use_totacct.*?general_stats_use_totacct: yes?g" /etc/freeradius-web/admin.conf
|
1021 |
$SED "s?^general_stats_use_totacct.*?general_stats_use_totacct: yes?g" /etc/freeradius-web/admin.conf
|
1026 |
$SED "s?^general_charset.*?general_charset: utf-8?g" /etc/freeradius-web/admin.conf
|
1022 |
$SED "s?^general_charset.*?general_charset: utf-8?g" /etc/freeradius-web/admin.conf
|
1027 |
[ -e /etc/freeradius-web/config.php.default ] || cp /etc/freeradius-web/config.php /etc/freeradius-web/config.php.default
|
- |
|
1028 |
cp -f $DIR_CONF/radius/freeradiusweb-config.php /etc/freeradius-web/config.php
|
- |
|
1029 |
cat <<EOF > /etc/freeradius-web/naslist.conf
|
1023 |
cat <<EOF > /etc/freeradius-web/naslist.conf
|
1030 |
nas1_name: alcasar-$ORGANISME
|
1024 |
nas1_name: alcasar-$ORGANISME
|
1031 |
nas1_model: Portail captif
|
1025 |
nas1_model: Portail captif
|
1032 |
nas1_ip: $PRIVATE_IP
|
1026 |
nas1_ip: $PRIVATE_IP
|
1033 |
nas1_port_num: 0
|
1027 |
nas1_port_num: 0
|