Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 635 → Rev 636

/alcasar.sh
267,13 → 267,15
network ()
{
header_install
if [ $Lang == "fr" ]
then echo "Par défaut, l'adresse IP d'ALCASAR sur le réseau de consultation est : $DEFAULT_PRIVATE_IP_MASK"
else echo "The default ALCASAR IP address on consultation network is : $DEFAULT_PRIVATE_IP_MASK"
fi
response=0
PTN='^[oOyYnN]$'
until [[ $(expr $response : $PTN) -gt 0 ]]
if [ "$mode" != "update" ]
then
if [ $Lang == "fr" ]
then echo "Par défaut, l'adresse IP d'ALCASAR sur le réseau de consultation est : $DEFAULT_PRIVATE_IP_MASK"
else echo "The default ALCASAR IP address on consultation network is : $DEFAULT_PRIVATE_IP_MASK"
fi
response=0
PTN='^[oOyYnN]$'
until [[ $(expr $response : $PTN) -gt 0 ]]
do
if [ $Lang == "fr" ]
then echo -n "Voulez-vous utiliser cette addresse et ce plan d'adressage (recommandé) (O/n)? : "
281,11 → 283,11
fi
read response
done
if [ "$response" = "n" ] || [ "$response" = "N" ]
then
PRIVATE_IP_MASK="0"
PTN='^\([01]\?[[:digit:]][[:digit:]]\?\|2[0-4][[:digit:]]\|25[0-5]\).\([01]\?[[:digit:]][[:digit:]]\?\|2[0-4][[:digit:]]\|25[0-5]\).\([01]\?[[:digit:]][[:digit:]]\?\|2[0-4][[:digit:]]\|25[0-5]\).\([01]\?[[:digit:]][[:digit:]]\?\|2[0-4][[:digit:]]\|25[0-5]\)/[012]\?[[:digit:]]$'
until [[ $(expr $PRIVATE_IP_MASK : $PTN) -gt 0 ]]
if [ "$response" = "n" ] || [ "$response" = "N" ]
then
PRIVATE_IP_MASK="0"
PTN='^\([01]\?[[:digit:]][[:digit:]]\?\|2[0-4][[:digit:]]\|25[0-5]\).\([01]\?[[:digit:]][[:digit:]]\?\|2[0-4][[:digit:]]\|25[0-5]\).\([01]\?[[:digit:]][[:digit:]]\?\|2[0-4][[:digit:]]\|25[0-5]\).\([01]\?[[:digit:]][[:digit:]]\?\|2[0-4][[:digit:]]\|25[0-5]\)/[012]\?[[:digit:]]$'
until [[ $(expr $PRIVATE_IP_MASK : $PTN) -gt 0 ]]
do
if [ $Lang == "fr" ]
then echo -n "Entrez l'adresse IP d'ALCASAR au format CIDR (a.b.c.d/xx) : "
292,10 → 294,12
else echo -n "Enter ALCASAR IP address in CIDR format (a.b.c.d/xx) : "
fi
read PRIVATE_IP_MASK
 
done
else
PRIVATE_IP_MASK=$DEFAULT_PRIVATE_IP_MASK
fi
else
PRIVATE_IP_MASK=$DEFAULT_PRIVATE_IP_MASK
PRIVATE_IP_MASK=`grep PRIVATE_IP |cut -d"=" -f2` /tmp/conf/etc/alcasar.conf
fi
# Définition de la config réseau côté "LAN de consultation"
hostname $HOSTNAME
1383,7 → 1387,6
$DIR_DEST_BIN/alcasar-conf.sh --load
$SED "s?^INSTALL_DATE=.*?INSTALL_DATE=$DATE?g" $CONF_FILE
$SED "s?^VERSION=.*?VERSION=$VERSION?g" $CONF_FILE
$SED "s?^ORGANISM=.*?ORGANISM=$ORGANISM?g" $CONF_FILE
fi
rm -f /tmp/alcasar-conf*
chown -R root:apache $DIR_DEST_ETC/*
1460,7 → 1463,7
MAJ_RUNNING_VERSION=`echo $RUNNING_VERSION|cut -d"." -f1`
MIN_RUNNING_VERSION=`echo $RUNNING_VERSION|cut -d"." -f2|cut -c1`
UPD_RUNNING_VERSION=`echo $RUNNING_VERSION|cut -d"." -f3`
# Create the conf file of the running version
# Create a backup of running version importants files
chmod u+x $DIR_SCRIPTS/alcasar-conf.sh
$DIR_SCRIPTS/alcasar-conf.sh --create
mode="update"
1477,11 → 1480,13
# Uninstall the running version
$DIR_SCRIPTS/sbin/alcasar-uninstall.sh
fi
# Test if manual update
if [ -e /tmp/alcasar-conf.tar.gz ] && [ "$mode" != "update" ]
then
header_install
if [ $Lang == "fr" ]
then echo -n "Le fichier de configuration d'une ancienne version a été trouvé";
else echo -n "The configuration file of an old version has been found";
then echo "Le fichier de configuration d'une ancienne version a été trouvé";
else echo "The configuration file of an old version has been found";
fi
response=0
PTN='^[oOnNyY]$'
1497,6 → 1502,7
fi
done
fi
# Test if update
if [ -e /tmp/alcasar-conf.tar.gz ]
then
if [ $Lang == "fr" ]
1503,9 → 1509,9
then echo "#### Installation avec mise à jour ####";
else echo "#### Installation with update ####";
fi
# Read the organism name from the conf file
tar -xvf /tmp/alcasar-conf.tar.gz conf/organisme
ORGANISME=`cat $DIR_CONF/organisme`
# Extract the central configuration file
tar -xvf /tmp/alcasar-conf.tar.gz conf/etc/alcasar.conf -C /tmp
ORGANISME=`cat /tmp/conf/etc/alcasar.conf|grep ORGANISM|cut -d"=" -f2`
mode="update"
else
mode="install"