summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2023-06-07 16:01:56 -0700
committerKai Stevenson <kai@kaistevenson.com>2023-06-07 16:01:56 -0700
commit83e2ee60c937281937e968d8e6f32ba6961355fb (patch)
treefaf0f9642f419609dbaae4c737d0471a271fa820
parent36e1bf9bf77fb1e2bdb78965496169520de0eb57 (diff)
QOL
-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