summaryrefslogtreecommitdiff
path: root/syncmusic-interactive
diff options
context:
space:
mode:
Diffstat (limited to 'syncmusic-interactive')
-rwxr-xr-xsyncmusic-interactive11
1 files changed, 8 insertions, 3 deletions
diff --git a/syncmusic-interactive b/syncmusic-interactive
index 8aa353b..b9d608d 100755
--- a/syncmusic-interactive
+++ b/syncmusic-interactive
@@ -54,6 +54,7 @@ do
done
" > /tmp/remotemusiclist
+touch /tmp/localonlymusicd
LOCALONLYCOUNT=0
LOCALONLYMUSIC=()
UNSYNCCOUNT=0
@@ -89,6 +90,10 @@ done < /tmp/remotemusiclist
echo -e $WHITE
echo "Discovered $UNSYNCCOUNT unsynced albums"
+if [ $UNSYNCCOUNT = 0 ]
+then
+ exit
+fi
echo "Albums in BLUE are those that are only on the local machine. Albums in GREEN are those that are only on the remote machine. Albums in WHITE are those that are on both"
read -p "Enter the indexes corresponding to the albums you wish to sync, separated by spaces: " INPUT
@@ -99,19 +104,19 @@ do
FDIR=$LOCALDIR/${LOCALONLYMUSIC[$((j-1))]}
TDIR=$REMOTE:$REMOTEDIR/${LOCALONLYMUSIC[$((j-1))]}
COMMAND="rsync -avzP --mkpath $FDIR $TDIR"
- echo $COMMAND >> /tmp/syncmusictorun
+ echo "$COMMAND" >> /tmp/syncmusictorun
else
FDIR=$REMOTE:$REMOTEDIR/${REMOTEONLYMUSIC[$(($j-$LOCALONLYCOUNT-1))]}
TDIR=$LOCALDIR/${REMOTEONLYMUSIC[$(($j-$LOCALONLYCOUNT-1))]}
COMMAND="rsync -avzP --mkpath $FDIR $TDIR"
- echo $COMMAND >> /tmp/syncmusictorun
+ echo "$COMMAND" >> /tmp/syncmusictorun
fi
done
echo "WILL RUN: $(cat /tmp/syncmusictorun)"
read -p "Enter y to confirm: " CONFIRM
if [[ $CONFIRM = y ]]
then
- $(cat /tmp/syncmusictorun)
+ source /tmp/syncmusictorun
fi
rm /tmp/remotemusiclist
rm /tmp/localmusiclist