1,17 → 1,17 |
#!/bin/bash |
# $Id: alcasar-rpm-dowwload.sh 922 2012-07-02 22:37:19Z richard $ |
#!/bin/sh |
# $Id: alcasar-urpmi.sh 838 2012-03-14 22:56:41Z richard $ |
|
# alcasar-urpmi.sh |
# by Franck BOUIJOUX and Richard REY |
# This script is distributed under the Gnu General Public License (GPL) |
|
# récupération des RPM nécessaire dans un fichier tarball |
# retrieve needed RPM in a yarball file |
# script de mise en place des dépots RPM |
# configure the RPM repository |
|
VERSION="2010.2" |
ARCH="i586" |
TO_ARCH="i586 x86_64" |
# ****** 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 buffer vim-enhanced bind-utils arpscan ulogd openssh-server php-xml php-ldap pam_ccreds rng-utils lsb-release dnsmasq sudo syslinux rsync cronie-anacron pciutils clamav pm-fallback-policy " |
PACKAGES="freeradius freeradius-mysql freeradius-ldap freeradius-web apache-mpm-prefork apache-mod_ssl apache-mod_php squid dansguardian postfix MySQL logwatch ntp awstats buffer vim-enhanced bind-utils arpscan ulogd openssh-server php-xml php-ldap pam_ccreds rng-utils lsb-release dnsmasq sudo syslinux cronie-anacron pciutils clamav pm-fallback-policy " |
|
rpm_repository_sync () |
{ |
35,21 → 35,14 |
echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-urpmi.sh'" |
} |
|
# extract the current architecture (i586 ou X64) |
fic=`cat /etc/product.id` |
old="$IFS" |
IFS="," |
set $fic |
for i in $* |
# We prefer wget than curl |
urpmi --no-verify-rpm --auto wget |
|
# Clean the RPM cache |
urpmi --clean |
|
for ARCH in $TO_ARCH |
do |
if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ] |
then |
ARCH=`echo $i|cut -d"=" -f2` |
fi |
done |
IFS="$old" |
# We prefer wget than curl |
urpmi --no-verify-rpm --auto ../../conf/rpms/$ARCH/wget*.rpm |
# Set the RPM repository |
MIRROR_NBR=2 |
# For french ALCASARistes |
86,20 → 79,9 |
fi |
fi |
done |
# delete unused RPMs |
echo "Cleaning the system : " |
for rm_rpm in shorewall dhcp-server cyrus-sasl distcache-server avahi mandi radeontool mondo mindi |
do |
/usr/sbin/urpme --auto $rm_rpm --auto-orphans 2>/dev/null |
echo -n "." |
done |
urpmi --clean |
# download RPM in cache |
echo "Récupération des paquetages de mise à jour. Veuillez patienter ..." |
echo "Updated RPM download. Please wait ..." |
echo "Il est temps d'aller prendre un café :-) " |
echo "You should now take a Beer ;-) " |
urpmi --auto --auto-update --quiet --test --retry 2 |
|
urpmi --auto --auto-update --quiet --test --retry 2 --download-all /tmp/$ARCH |
|
if [ "$?" != "0" ] |
then |
echo |
108,36 → 90,8 |
rpm_error |
exit 1 |
fi |
# update with cached RPM |
urpmi --auto --auto-update --noclean |
if [ "$?" != "0" ] |
then |
echo |
echo "Une erreur a été détectée lors de la mise à jour des paquetages." |
echo "An error occurs when updating packages" |
rpm_error |
exit 1 |
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 --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 |
echo "archive creation. Please wait..." |
cd /var/cache/urpmi |
tar -czf rpms-$ARCH.tar.gz rpms/ |
# Clean the RPM cache |
urpmi --clean |
mv rpms-$ARCH.tar.gz /root/ |
cd |
echo "Your RPM archive : rpms-$ARCH.tar.gz" |
done |
|
exit 0 |
|