Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1528 → 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,78 → 162,58
$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
if [ -e /tmp/alcasar-conf.tar.gz ] # update
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 ]
then
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`
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"
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 "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 "The OS must be replaced (Mageia4)"
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 [ -e /tmp/alcasar-conf.tar.gz ]
then
echo
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"
fi
else
if [ $Lang == "fr" ]
then
echo "L'installation d'ALCASAR ne peut pas être réalisée."
else
echo "The installation of ALCASAR can't be performed."
fi
exit 0
fi
echo
if [ $Lang == "fr" ]
then
echo "Le système d'exploitation doit être remplacé (Mageia4.1)"
else
echo "The OS must be replaced (Mageia4.1)"
fi
exit 0
fi
if [ ! -d /var/log/netflow/porttracker ]
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 ]
then
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
if [ $Lang == "fr" ]
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
/conf/sudoers
12,7 → 12,7
User_Alias ADMWEB=apache # compte lié à l'interface de gestion
 
# Cmnd alias specification
Cmnd_Alias NET=/sbin/ip,/sbin/arping,/sbin/arp,/usr/sbin/arpscan,/usr/sbin/tcpdump,/usr/local/bin/alcasar-watchdog.sh,/usr/local/sbin/alcasar-dhcp.sh # commandes réseau
Cmnd_Alias NET=/sbin/ip,/sbin/arping,/sbin/arp,/usr/sbin/tcpdump,/usr/local/bin/alcasar-watchdog.sh,/usr/local/sbin/alcasar-dhcp.sh # commandes réseau
Cmnd_Alias URPMI=/usr/sbin/urpmi,/usr/sbin/urpmi.update # gestion des paquetages
Cmnd_Alias BYPASS=/usr/local/sbin/alcasar-bypass.sh # contournement du système d'authentification
Cmnd_Alias RADDB=/usr/bin/radwho,/usr/sbin/chilli_query # pour la gestion des usagers en ligne
/readme.txt
1,9 → 1,9
$Id: readme-2.0.txt 581 2011-04-21 16:59:59Z richard $
 
Alcasar-2.8
Alcasar-2.9
 
*********** English **********
- New installation : Need the CD dual architecture (32b and 64b) of Linux Mageia2 (Mageia-2-dual-CD.iso).
- New installation : Need the DVD dual architecture (32b and 64b) of Linux Mageia4.1 (Mageia-4.1-dual-DVD.iso).
--> Follow the installation documentation.
- Update an earlier version
--> Run the installation of the new version and follow the instructions
14,7 → 14,7
 
*********** Français ********
 
- Nouvelle installation : elle s'effectue sur la base CD double architectures (32b et 64b) de Linux Mageia2 (Mageia-2-dual-CD.iso).
- Nouvelle installation : elle s'effectue sur la base DVD double architectures (32b et 64b) de Linux Mageia4.1 (Mageia-4.1-dual-DVD.iso).
--> Suivez la procédure d'installation.
- Mise à jour d'une ancienne version :
--> Lancez l'installation de la nouvelle version et suivez les instructions
/scripts/alcasar-conf.sh
115,7 → 115,7
$SED "/blacklists\/ip/d" $DIR_UPDATE/etc/alcasar-bl-categories; $SED "/^ip/d" $DIR_UPDATE/etc/alcasar-bl-categories-enabled
# BL and WL are now dynamically built in "/usr/local/share"
rm -rf $DIR_UPDATE/etc/alcasar-dnsfilter-enabled $DIR_UPDATE/etc/alcasar-dnsfilter-available
# Bing et Youtube are addes to the safesearching system
# Bing et Youtube are added to the safesearching system
Bing=`grep bing $DIR_UPDATE/urlregexplist | wc -l`
if [ $Bing -ne "1" ]; then
SafeSearch=`grep ^\"\(\^http\:\/\/ $DIR_UPDATE/urlregexplist | wc -l`
135,18 → 135,16
EOF
fi
fi
# la variable YOUTUBE_ID est déclarée dans le fichier de conf
# YOUTUBE_ID variable added in the conf file
YOUTUBE_ID=`grep ^YOUTUBE_ID $CONF_FILE | cut -d"=" -f2`
YOUTUBE_ID=${YOUTUBE_ID:="-1"}
if [ $YOUTUBE_ID = "-1" ]; then
echo "YOUTUBE_ID=ABCD1234567890abcdef" >> $CONF_FILE
fi
# copie du fichier de config de dnsmasq
# DNSMASQ conf file
cp /etc/sysconfig/dnsmasq $DIR_UPDATE
# copie du fichier de conf modifié
# ALCASAR conf file
cp $CONF_FILE $DIR_UPDATE/etc/
# le répertoire "ISO" est remplacé par "system_backup" suite à la suppression de "mondoarchive" (V2.5)
rm -rf /var/Save/ISO
# création de l'archive et copie dans le répertoire WEB associé
cd /tmp
tar -cf alcasar-conf.tar conf/
/scripts/alcasar-urpmi.sh
40,7 → 40,6
}
# extract the current Mageia version and hardware architecture (i586 ou X64)
fic=`cat /etc/product.id`
unknown_os=0
old="$IFS"
IFS=","
set $fic
49,46 → 48,17
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"
if [[ ( $unknown_os != 3 || "$DISTRIBUTION" != "Mageia" ) && ( "$CURRENT_VERSION" != "4" ) ]]
then
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)"
else
echo "The automatic update of ALCASAR can't be performed."
echo "The OS must be replaced (Mageia4)"
fi
if [ -e /tmp/alcasar-conf.tar.gz ]
then
echo
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"
fi
fi
exit 1
fi
# We prefer wget than curl
urpmi --no-verify-rpm --auto conf/rpms/$ARCH/wget*.rpm
# Set the RPM repository (if not already set)