Subversion Repositories ALCASAR

Compare Revisions

Regard whitespace Rev 1527 → Rev 1529

/alcasar.sh
104,11 → 104,38
##################################################################
## Function "testing" ##
## - Test of Mageia version ##
## - Test of ALCASAR version (if already installed) ##
## - Test of free space on /var (>10G) ##
## - Test of Internet access ##
##################################################################
testing ()
{
# Test of Mageia version
# extract the current Mageia version and hardware architecture (i586 ou X64)
fic=`cat /etc/product.id`
unknown_os=0
old="$IFS"
IFS=","
set $fic
for i in $*
do
if [ "`echo $i|grep distribution|cut -d'=' -f1`" == "distribution" ]
then
DISTRIBUTION=`echo $i|cut -d"=" -f2`
unknown_os=`expr $unknown_os + 1`
fi
if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ]
then
CURRENT_VERSION=`echo $i|cut -d"=" -f2`
unknown_os=`expr $unknown_os + 1`
fi
if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
then
ARCH=`echo $i|cut -d"=" -f2`
unknown_os=`expr $unknown_os + 1`
fi
done
IFS="$old"
# Test if ALCASAR is already installed
if [ -e $CONF_FILE ]
then
135,70 → 162,51
$DIR_SCRIPTS/alcasar-conf.sh --create
mode="update"
fi
else
if [ ! -d /var/log/netflow/porttracker ]
fi
if [[ ( $unknown_os != 3 ) || ("$DISTRIBUTION" != "Mageia" ) || ( "$CURRENT_VERSION" != "4" ) ]]
then
# Test of free space on /var
free_space=`df -BG --output=avail /var|tail -1|tr -d [:space:]G`
if [ $free_space -lt 10 ]
if [ -e /tmp/alcasar-conf.tar.gz ] # update
then
echo
if [ $Lang == "fr" ]
then echo "place disponible sur /var insufisante ($free_space Go au lieu de 10 Go au minimum)"
else echo "not enough free space on /var ($free_space GB instead of at least 10 GB)"
fi
exit 0
fi
fi
# Test of Mageia version
# extract the current Mageia version and hardware architecture (i586 ou X64)
fic=`cat /etc/product.id`
unknown_os=0
old="$IFS"
IFS=","
set $fic
for i in $*
do
if [ "`echo $i|grep distribution|cut -d'=' -f1`" == "distribution" ]
then
DISTRIBUTION=`echo $i|cut -d"=" -f2`
unknown_os=`expr $unknown_os + 1`
echo "La mise à jour automatique d'ALCASAR ne peut pas être réalisée."
echo "1 - Récupérez le fichier de configuration actuel (/tmp/alcasar-conf.tar.gz)."
echo "2 - Installez Linux-Mageia4.1 (cf. doc d'installation)"
echo "3 - recopiez le fichier 'alcasar-conf.tar.gz' dans le répertoire '/tmp' avant de lancer l'installation d'ALCASAR"
else
echo "The automatic update of ALCASAR can't be performed."
echo "1 - Retrieve the configuration file (/tmp/alcasar-conf.tar.gz)"
echo "2 - Install Linux-Mageia4.1 (cf. installation doc)"
echo "3 - Copy again the file 'alcasar-conf.tar.gz' in the folder '/tmp' before launching the installation of ALCASAR"
fi
if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ]
else
if [ $Lang == "fr" ]
then
CURRENT_VERSION=`echo $i|cut -d"=" -f2`
unknown_os=`expr $unknown_os + 1`
echo "L'installation d'ALCASAR ne peut pas être réalisée."
else
echo "The installation of ALCASAR can't be performed."
fi
if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
then
ARCH=`echo $i|cut -d"=" -f2`
unknown_os=`expr $unknown_os + 1`
fi
done
IFS="$old"
if [[ ( $unknown_os != 3 || "$DISTRIBUTION" != "Mageia" ) && ( "$CURRENT_VERSION" != "4" ) ]]
then
echo
if [ $Lang == "fr" ]
then
echo "L'installation ou la mise @ jour d'ALCASAR ne peut pas être réalisée."
echo "Le système d'exploitation doit être remplacé (Mageia4)"
echo "Le système d'exploitation doit être remplacé (Mageia4.1)"
else
echo "The automatic update of ALCASAR can't be performed."
echo "The OS must be replaced (Mageia4)"
echo "The OS must be replaced (Mageia4.1)"
fi
if [ -e /tmp/alcasar-conf.tar.gz ]
exit 0
fi
if [ ! -d /var/log/netflow/porttracker ]
then
echo
# Test of free space on /var
free_space=`df -BG --output=avail /var|tail -1|tr -d [:space:]G`
if [ $free_space -lt 10 ]
then
if [ $Lang == "fr" ]
then
echo "1 - Récupérez le fichier de configuration actuel (/tmp/alcasar-conf.tar.gz)."
echo "2 - Installez Linux-Mageia4 (cf. doc d'installation)"
echo "3 - copiez le fichier 'alcasar-conf.tar.gz' dans le répertoire '/tmp' avant de lancer l'installation d'ALCASAR"
else
echo "1 - Retrieve the configuration file (/tmp/alcasar-conf.tar.gz)"
echo "2 - Install Linux-Mageia4 (cf. installation doc)"
echo "3 - Copy the file 'alcasar-conf.tar.gz' in the folder '/tmp' before launching the installation of ALCASAR"
then echo "place disponible sur /var insufisante ($free_space Go au lieu de 10 Go au minimum)"
else echo "not enough free space on /var ($free_space GB instead of at least 10 GB)"
fi
fi
exit 0
fi
fi
206,7 → 214,6
then echo -n "Tests des paramètres réseau : "
else echo -n "Network parameters tests : "
fi
 
# Test of Ethernet links state
DOWN_IF=`/sbin/ip link|grep "NO-CARRIER"|cut -d":" -f2|tr -d " "`
for i in $DOWN_IF