Subversion Repositories ALCASAR

Rev

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

Rev 2811 Rev 2829
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-mysql.sh 2811 2020-04-15 22:07:11Z rexy $
2
# $Id: alcasar-mysql.sh 2829 2020-06-01 21:56:41Z rexy $
3
 
3
 
4
# alcasar-mysql.sh
4
# alcasar-mysql.sh
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
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
 
7
 
8
# Gestion (sauvegarde / import / RAZ) de la base MySQL 'radius'. Fermeture des sessions de comptabilité ouvertes
8
# Gestion (sauvegarde / import / RAZ) de la base MySQL 'radius'. Fermeture des sessions de comptabilité ouvertes
9
# Management of mysql 'radius' database (save / import / RAZ). Close the accounting open sessions
9
# Management of mysql 'radius' database (save / import / RAZ). Close the accounting open sessions
10
 
10
 
11
rep_tr="/var/Save/base"				# répertoire d'accueil des sauvegardes
11
rep_tr="/var/Save/base"
12
DIR_BIN="/usr/local/bin"
12
DIR_BIN="/usr/local/bin"
13
PASSWD_FILE="/root/ALCASAR-passwords.txt"
13
PASSWD_FILE="/root/ALCASAR-passwords.txt"
14
DB_RADIUS="radius"
14
DB_RADIUS="radius"
15
DB_USER=$(grep '^db_user=' $PASSWD_FILE | cut -d'=' -f 2-)
15
DB_USER=$(grep '^db_user=' $PASSWD_FILE | cut -d'=' -f 2-)
16
DB_PASS=$(grep '^db_password=' $PASSWD_FILE | cut -d'=' -f 2-)
16
DB_PASS=$(grep '^db_password=' $PASSWD_FILE | cut -d'=' -f 2-)
17
new="$(date +%G%m%d-%Hh%M)"			# date et heure des fichiers
17
new="$(date +%G%m%d-%Hh%M)"			# date & hour of files 
18
fichier="alcasar-users-database-$new.sql"	# nom du fichier de sauvegarde
18
fichier="alcasar-users-database-$new.sql"
19
 
19
 
20
 
20
 
21
stop_acct ()
21
stop_acct ()
22
{
22
{
23
	date_now=`date "+%F %X"`
23
	date_now=`date "+%F %X"`