#!/bin/sh REMOTEDIR=aberrant@canonical.aberrantflux.xyz:/srv/music/ LOCALDIR=$(pwd) echo "Remote directory is at $REMOTEDIR" echo "Local dir is at $LOCALDIR" echo "To sync from remote to local, enter d. To sync from local to remote, enter u. To cancel, enter c" printf "Direction: " read DIRECTION if [ $DIRECTION = d ] then COMMAND="rsync -avzP $REMOTEDIR/* $LOCALDIR/" echo "About to run $COMMAND - enter y to continue, or n to cancel" printf "Confirm: " read CONFIRMATION if [ $CONFIRMATION = y ] then rsync -avzP $REMOTEDIR/* $LOCALDIR/ fi fi if [ $DIRECTION = u ] then COMMAND="rsync -avzP $LOCALDIR/* $REMOTEDIR/" echo "About to run $COMMAND - enter y to continue, or n to cancel" printf "Confirm: " read CONFIRMATION if [ $CONFIRMATION = y ] then rsync -avzP $LOCALDIR/* $REMOTEDIR/ fi fi