Subversion Repositories ALCASAR

Compare Revisions

No changes between revisions

Ignore whitespace Rev 531 → Rev 532

/alcasar.sh
34,7 → 34,7
# dnsmasq : Configuration du serveur de noms et du serveur dhcp de secours
# BL : Configuration de la BlackList
# cron : Mise en place des exports de logs (+ chiffrement)
# post_install : Finalisation environnement ( CA, bannières, rotatoin logs, ...)
# post_install : Finalisation environnement ( sécurité, bannières, rotation logs, ...)
 
VERSION=`cat VERSION`
DATE=`date '+%d %B %Y - %Hh%M'`
63,8 → 63,6
SQUID_PORT="3128" # Port d'écoute du proxy Squid
# ****** Paths - chemin des commandes *******
SED="/bin/sed -i"
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ******
PACKAGES="freeradius freeradius-mysql freeradius-ldap freeradius-web apache-mpm-prefork apache-mod_ssl apache-mod_php squid dansguardian postfix MySQL logwatch ntp awstats mondo cdrecord buffer vim-enhanced bind-utils wget arpscan ulogd openssh-server php-xml pam_ccreds rng-utils lsb-release dnsmasq sudo cronie-anacron pciutils clamav pm-fallback-policy"
# ****************** End of global parameters *********************
 
header_install ()
165,8 → 163,6
## Fonction INIT ##
## - Création du fichier "/root/ALCASAR_parametres.txt" ##
## - Installation et modification des scripts du portail ##
## - Mise à jour système ##
## - Installation des paquetages complémentaires ##
##################################################################
init ()
{
186,70 → 182,6
fi
done
fi
# System update
$DIR_SCRIPTS/alcasar-urpmi.sh
if [ "$?" != "0" ]
then
exit 0
fi
# Download of ALCASAR specifics RPM in cache (and test)
echo "Récupération des paquetages complémentaires. Veuillez patienter ..."
echo "Download of complementary packages. Please wait ..."
urpmi --wget --auto $PACKAGES --quiet --test --retry 2
if [ "$?" != "0" ]
then
echo
echo "Une erreur a été détectée lors de la récupération des paquetages complémentaires."
echo "Relancez l'installation ultérieurement."
echo "Si vous rencontrez à nouveau ce problème, modifier la variable MIRRORLIST du fichier 'scripts/alcasar-urpmi.sh'"
echo "An error occurs when downloading complementary packages"
echo "Try an other install later."
echo "If this problem occurs again, change the MIRRORLIST variable in the file 'scripts/alcasar-urpmi.sh'"
exit 0
fi
# update with cached RPM
urpmi --auto $PACKAGES
# On supprime les paquetages, les services et les utilisateurs inutiles
for rm_rpm in shorewall dhcp-server c-icap-server cyrus-sasl distcache-server avahi mandi radeontool
do
/usr/sbin/urpme --auto $rm_rpm --auto-orphans 2>/dev/null
echo -n "."
done
for svc in alsa sound dm atd netfs bootlogd stop-bootlogd
do
/sbin/chkconfig --del $svc
done
for rm_users in avahi-autoipd avahi icapd
do
user=`cat /etc/passwd|grep $rm_users|cut -d":" -f1`
if [ "$user" == "$rm_users" ]
then
/usr/sbin/userdel -f $rm_users
fi
done
# extract the current architecture (i586 ou X64)
fic=`cat /etc/product.id`
ARCH="i586"
old="$IFS"
IFS=","
set $fic
for i in $*
do
if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
then
ARCH=`echo $i|cut -d"=" -f2`
fi
done
IFS="$old"
# On installe les RPMs spécifiques à la version
urpmi --no-verify --auto $DIR_CONF/rpms/$ARCH/*.rpm
# On empêche les mises à jour de coova-chilli et freeradius par le biais des dépôts
for rpmskip in coova freeradius
do
echo -n "/^$rpmskip/" >> /etc/urpmi/skip.list
done
# On vide le répertoire temporaire
urpmi --clean
# On crée aléatoirement les mots de passe et les secrets partagés
rm -f $FIC_PASSWD
grubpwd=`cat /dev/urandom | tr -dc [:alnum:] | head -c8` # mot de passe de protection du menu Grub
1327,6 → 1259,19
# On limite le temps d'attente de grub (3s) et on change la résolution d'écran
$SED "s?^timeout.*?timeout 3?g" /boot/grub/menu.lst
$SED "s?^kernel.*?& vga=791?g" /boot/grub/menu.lst
# On supprime les services et les utilisateurs inutiles
for svc in alsa sound dm atd netfs bootlogd stop-bootlogd
do
/sbin/chkconfig --del $svc
done
for rm_users in avahi-autoipd avahi icapd
do
user=`cat /etc/passwd|grep $rm_users|cut -d":" -f1`
if [ "$user" == "$rm_users" ]
then
/usr/sbin/userdel -f $rm_users
fi
done
# dans le cas d'une mise à jour, on charge la conf d'une version précédente
if [ "$mode" = "update" ]
then
1404,14 → 1349,21
# On crée le fichier de conf de la version actuelle
chmod u+x $DIR_SCRIPTS/alcasar-conf.sh
$DIR_SCRIPTS/alcasar-conf.sh --create
mode="update"
fi
# On désinstalle la version actuelle
$DIR_SCRIPTS/sbin/alcasar-uninstall.sh
fi
if [ -e /tmp/alcasar-conf.tar.gz ]
# System update - rpms install
$DIR_SCRIPTS/alcasar-urpmi.sh
if [ "$?" != "0" ]
then
exit 0
fi
if [ -e /tmp/alcasar-conf.tar.gz ]
then
echo "#### Installation avec mise à jour ####"
echo "#### Installation with update ####"
echo "#### Installation avec mise à jour ####"
echo "#### Installation with update ####"
# On désinstalle la version actuelle
$DIR_SCRIPTS/sbin/alcasar-uninstall.sh
# On récupère le nom d'organisme à partir de fichier de conf
tar -xvf /tmp/alcasar-conf.tar.gz conf/organisme
ORGANISME=`cat $DIR_CONF/organisme`
/conf/rpms/i586/clamav-db-0.97-69.2mib2010.2.i686.rpm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/conf/rpms/i586/wget-1.12-4.1mdv2010.1.i586.rpm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/conf/rpms/i586/libclamav6-0.97-69.2mib2010.2.i686.rpm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/conf/rpms/i586/clamav-0.97-69.2mib2010.2.i686.rpm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/conf/rpms/x86_64/clamav-0.97-69.2mib2010.2.x86_64.rpm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/conf/rpms/x86_64/clamav-db-0.97-69.2mib2010.2.x86_64.rpm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/conf/rpms/x86_64/lib64clamav6-0.97-69.2mib2010.2.x86_64.rpm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/conf/rpms/x86_64/wget-1.12-4.1mdv2010.1.x86_64.rpm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/scripts/alcasar-urpmi.sh
5,6 → 5,8
 
VERSION="2010.2"
ARCH="i586"
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ******
PACKAGES="freeradius freeradius-mysql freeradius-ldap freeradius-web apache-mpm-prefork apache-mod_ssl apache-mod_php squid dansguardian postfix MySQL logwatch ntp awstats mondo cdrecord buffer vim-enhanced bind-utils wget arpscan ulogd openssh-server php-xml pam_ccreds rng-utils lsb-release dnsmasq sudo cronie-anacron pciutils clamav pm-fallback-policy"
 
rpm_repository_sync ()
{
11,12 → 13,19
echo ${!MIRRORLIST}
urpmi.removemedia -a
urpmi.addmedia --wget --probe-synthesis --mirrorlist ${!MIRRORLIST} main /media/main/release
urpmi --auto wget
urpmi.addmedia --wget --update --probe-synthesis --mirrorlist ${!MIRRORLIST} main_updates /media/main/updates
urpmi.addmedia --wget --probe-synthetis --mirrorlist ${!MIRRORLIST} contrib /media/contrib/release
urpmi.addmedia --wget --probe-synthesis --mirrorlist ${!MIRRORLIST} contrib /media/contrib/release
urpmi.addmedia --wget --update --probe-synthesis --mirrorlist ${!MIRRORLIST} contrib_updates /media/contrib/updates
}
 
rpm_error ()
{
echo
echo "Relancez l'installation ultérieurement."
echo "Si vous rencontrez à nouveau ce problème, modifier les variables MIRRORLIST[1&2] du fichier 'scripts/alcasar-urpmi.sh'"
echo "Try an other install later."
echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-urpmi.sh'"
}
# extract the current Mandriva version and hardware architecture (i586 ou X64)
fic=`cat /etc/product.id`
old="$IFS"
42,6 → 51,8
fi
done
IFS="$old"
# We prefer wget than curl
urpmi --no-verify-rpm conf/rpms/$ARCH/wget*.rpm
# Set the RPM repository
MIRROR_NBR=2
# For french ALCASARistes
61,11 → 72,7
echo "An error occurs when synchronising the repositories N°$try_nb"
if [ $(expr $try_nb) -eq $MIRROR_NBR ]
then
echo
echo "Relancez l'installation ultérieurement."
echo "Si vous rencontrez à nouveau ce problème, modifier les variables MIRRORLIST[1&2] du fichier 'scripts/alcasar-urpmi.sh'"
echo "Try an other install later."
echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-urpmi.sh'"
rpm_error
exit 1
fi
echo "Voulez-vous tenter une synchronisation avec un autre dépôt?"
92,16 → 99,40
then
echo
echo "Une erreur a été détectée lors de la récupération des paquetages."
echo "Relancez l'installation ultérieurement."
echo "Si vous rencontrez à nouveau ce problème, modifier les variables MIRRORLIST[1&2] du fichier 'scripts/alcasar-urpmi.sh'"
echo "An error occurs when downloading"
echo "Try an other install later."
echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-urpmi.sh'"
rpm_error
exit 1
fi
# update with cached RPM
urpmi --auto --auto-update
# cleaning
urpme --auto --auto-orphans
# Download of ALCASAR specifics RPM in cache (and test)
echo "Récupération des paquetages complémentaires. Veuillez patienter ..."
echo "Download of complementary packages. Please wait ..."
urpmi --downloader=wget --auto $PACKAGES --quiet --test --retry 2
if [ "$?" != "0" ]
then
echo
echo "Une erreur a été détectée lors de la récupération des paquetages complémentaires."
echo "An error occurs when downloading complementary packages"
rpm_error
exit 1
fi
# update with cached RPM
urpmi --auto $PACKAGES
# On supprime les paquetages inutiles
for rm_rpm in shorewall dhcp-server c-icap-server cyrus-sasl distcache-server avahi mandi radeontool
do
/usr/sbin/urpme --auto $rm_rpm --auto-orphans 2>/dev/null
echo -n "."
done
# On installe les RPMs spécifiques à la version
urpmi --no-verify --auto conf/rpms/$ARCH/*.rpm
# On empêche les mises à jour de coova-chilli et freeradius par le biais des dépôts
for rpmskip in coova freeradius
do
echo -n "/^$rpmskip/" >> /etc/urpmi/skip.list
done
# Clean the RPM cache
urpmi --clean
exit 0