From: Silvio Rhatto Date: Tue, 8 Nov 2016 18:31:29 +0000 (-0200) Subject: Minor fixes at sync-media-remotes X-Git-Tag: 0.2.4~31 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=f9cdf97b556d29f8bb890bbdcab2d7fc3f82a835;p=hydra.git Minor fixes at sync-media-remotes --- diff --git a/share/hydractl/sync-media-remotes b/share/hydractl/sync-media-remotes index 1b8f59e..f3ea062 100755 --- a/share/hydractl/sync-media-remotes +++ b/share/hydractl/sync-media-remotes @@ -24,7 +24,7 @@ for folder in `ls $MEDIA`; do git -C $MEDIA/$folder remote -v | while read remote; do cd $DEST/$MEDIA/$folder name="`echo $remote | cut -d ' ' -f 1`" - addr="`echo $remote | cut -d ' ' -f 2`" + addr="`echo $remote | cut -d ' ' -f 2`" type="`echo $remote | cut -d ' ' -f 3`" if [ "$type" == "(push)" ]; then @@ -42,7 +42,7 @@ for folder in `ls $MEDIA`; do git -C $DEST/$MEDIA/$folder remote -v | while read remote; do cd $MEDIA/$folder name="`echo $remote | cut -d ' ' -f 1`" - addr="`echo $remote | cut -d ' ' -f 2`" + addr="`echo $remote | cut -d ' ' -f 2`" type="`echo $remote | cut -d ' ' -f 3`" if [ "$type" == "(push)" ]; then @@ -54,7 +54,10 @@ for folder in `ls $MEDIA`; do fi if ! git remote -v | sed -e 's/\t/ /g' | grep -q "^$name $addr $type$"; then - git -C $DEST/$MEDIA/$folder remote $command $name $arg + # Check if was not already removed by a previous command + if git -C $DEST/$MEDIA/$folder remote | grep -q "^$name$"; then + git -C $DEST/$MEDIA/$folder remote $command $name $arg + fi fi done fi