2019-01-16 20:41:33 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#mirror_mageia_hd
|
|
|
|
version="6"
|
|
|
|
dossier=""
|
|
|
|
boot=""
|
|
|
|
param=" --delete-excluded --exclude SRPMS/ --exclude *_testing/ --exclude */debug/ --exclude aarch64/ --exclude armv5tl/ --exclude armv7hl/ "
|
|
|
|
|
|
|
|
for DIRECTORY in /run/media/$USER/*
|
|
|
|
do
|
|
|
|
echo "$DIRECTORY"
|
|
|
|
if [ -d "$DIRECTORY" ]; then
|
|
|
|
if [ -e "$DIRECTORY/mageia/distrib" ]; then
|
|
|
|
echo "$DIRECTORY/mageia/distrib trouvé"
|
|
|
|
dossier=$DIRECTORY/mageia/distrib
|
|
|
|
elif [ -e "$DIRECTORY/extlinux" ]; then
|
|
|
|
echo "$DIRECTORY/extlinux trouvé"
|
2019-01-17 17:57:10 +01:00
|
|
|
boot="$DIRECTORY"
|
2019-01-16 20:41:33 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -z $dossier ] || [ -z $boot ]; then
|
|
|
|
for DIRECTORY in /mnt/tmp*
|
|
|
|
do
|
|
|
|
if [ -d "$DIRECTORY" ]; then
|
|
|
|
if [ -e "$DIRECTORY/mageia/distrib" ]; then
|
|
|
|
echo "$DIRECTORY/mageia/distrib trouvé"
|
|
|
|
dossier=$DIRECTORY/mageia/distrib
|
|
|
|
elif [ -e "$DIRECTORY/grub/menu.lst" ]; then
|
|
|
|
echo "$DIRECTORY/grub/menu.lst trouvé"
|
2019-01-17 17:57:10 +01:00
|
|
|
boot="$DIRECTORY"
|
2019-01-16 20:41:33 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z $dossier ] || [ -z $boot ]; then
|
2019-01-17 17:57:10 +01:00
|
|
|
echo "Erreur dossiers non trouvés"
|
2019-01-16 20:41:33 +01:00
|
|
|
echo "BOOT=$boot"
|
|
|
|
echo "Dossier=$dossier"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "/mirror/mageia/distrib/$version" ];then
|
|
|
|
serveur='/mirror'
|
|
|
|
else
|
|
|
|
serveur="rsync://fr2.rpmfind.net/linux"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n $dossier ] && [ -n $boot ];then
|
|
|
|
echo "rsync -avP $param $serveur/mageia/distrib/$version/ $dossier/$version/"
|
2019-01-17 17:57:10 +01:00
|
|
|
rsync -aP $param $serveur/mageia/distrib/$version $dossier/
|
2019-01-16 20:41:33 +01:00
|
|
|
|
|
|
|
cd $dossier/$version
|
|
|
|
echo "rsync -aP i586/isolinux/i386/vmlinuz $boot/vmlinuz_"$version"_i586"
|
2019-01-17 17:57:10 +01:00
|
|
|
rsync -aP i586/isolinux/i386/vmlinuz "$boot"/vmlinuz_"$version"_i586
|
|
|
|
echo "rsync -aP x86_64/isolinux/x86_64/vmlinuz $boot/vmlinuz_"$version"_x86_64"
|
|
|
|
rsync -aP x86_64/isolinux/x86_64/vmlinuz "$boot"/vmlinuz_"$version"_x86_64
|
|
|
|
rsync -aP i586/isolinux/i386/all.rdz "$boot"/all_"$version"_i586.rdz
|
|
|
|
rsync -aP x86_64/isolinux/x86_64/all.rdz "$boot"/all_"$version"_x86_64.rdz
|
2019-01-16 20:41:33 +01:00
|
|
|
|
|
|
|
# if [ -d "/mirror/mageia/distrib/cauldron" ];then
|
|
|
|
# serveur='/mirror'
|
|
|
|
# else
|
|
|
|
# serveur="rsync://fr2.rpmfind.net/linux"
|
|
|
|
# fi
|
|
|
|
# rsync -aP $param $serveur/mageia/distrib/cauldron/ $dossier/cauldron/
|
|
|
|
|
|
|
|
# cd $dossier/cauldron
|
|
|
|
# rsync -aP i586/isolinux/i386/vmlinuz $boot/vmlinuz_cauldron_i586
|
|
|
|
# rsync -aP x86_64/isolinux/x86_64/vmlinuz $boot/vmlinuz_cauldron_x86_64
|
|
|
|
# rsync -aP i586/isolinux/i386/all.rdz $boot/all_cauldron_i586.rdz
|
|
|
|
# rsync -aP x86_64/isolinux/x86_64/all.rdz $boot/all_cauldron_x86_64.rdz
|
|
|
|
fi
|