From 2d17309a6e512243c1146193aac185932b270d74 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Sat, 12 Jan 2019 17:36:07 +0100 Subject: [PATCH] minor bug --- mirror_mageia | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mirror_mageia b/mirror_mageia index 2306082..756cecf 100644 --- a/mirror_mageia +++ b/mirror_mageia @@ -13,18 +13,18 @@ MSG=/tmp/mirror_mageia.mail #SERVEUR="http://ftp.free.fr/mirrors/mageia.org" #SERVEUR="rsync://ftp.acc.umu.se/mirror/mageia/" SERVEUR="rsync://ftp.belnet.be/mageia" - echo "" >$MSG + function title() { echo -e "\e[1;32m$1\e[0m" - echo -e "\e[1;32m$1\e[0m" >>$MSG + echo -e "$1" >>$MSG } function info() { echo -e "\e[36m$1\e[0m" - echo -e "\e[36m$1\e[0m" >>$MSG + echo -e "$1" >>$MSG } iferror( ) #$RESULT, $TXT, $LINENO @@ -33,8 +33,8 @@ iferror( ) #$RESULT, $TXT, $LINENO echo -e "$2: réussi" echo -e "$2: réussi" >>$MSG else - echo -e "\e[36m$3 - $2\e[0m: échoué" - echo -e "\e[36m$3 - $2\e[0m: échoué" >>$MSG + echo -e "\e[36m$3 - $2\e[0m: échoué" + echo -e "$3 - $2: échoué" >>$MSG fi } @@ -42,10 +42,11 @@ iferror( ) #$RESULT, $TXT, $LINENO title "Synchronisation miroirs Mageia" pidof -o %PPID -x -s mirror_mageia if [ $? -eq 0 ];then + echo "" >$MSG info "mirror_mageia déjà lancé" else #Mageia current version - + echo "" >$MSG rsync -a -H -S -v --delete-after --delete-excluded --delay-updates --exclude="*testing" --exclude="*debug/" --exclude="SRPMS/" $SERVEUR/distrib/$PRESENT/ "$MIRRORPATH"/distrib/$PRESENT/ if [ $? -eq 0 ]; then @@ -74,7 +75,7 @@ else else info "Erreur rsync Mageia $PRESENT" - fiF + fi rsync -avP --exclude "*GNOME*" $SERVEUR/iso/$PRESENT* "$MIRRORPATH"/iso/ iferror "$?" "rsync Mageia $PRESENT isos" $LINENO @@ -149,4 +150,3 @@ else chmod a+rX -R "$MIRRORPATH"/distrib fi sendmail -f $FROMMAIL $DESTMAIL <$MSG -