summaryrefslogtreecommitdiff
path: root/share/hydractl
diff options
context:
space:
mode:
Diffstat (limited to 'share/hydractl')
-rwxr-xr-xshare/hydractl/sync-media-remotes9
1 files changed, 6 insertions, 3 deletions
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