Add ssh-agent to msync script

This commit is contained in:
dogeystamp 2022-01-29 11:39:32 -05:00
parent 1de5d2478d
commit 1d95f1ca2f
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -18,6 +18,17 @@ fi
if [ $ACTION = RECV ]
then
# Move files to the quarantine zone for categorisation and renaming
# Setup ssh agent to avoid repeated password prompts
eval `ssh-agent -s`
ssh-add ~/.ssh/keys/beryllium_n
rsync -avPzc beryllium:~/storage/pictures/Infinity/ ~/med/memes/woof/quar && \
ssh beryllium "rm -I storage/pictures/Infinity/*"
rsync -avPzc beryllium:~/storage/movies/Infinity/ ~/med/memes/woof/quar && \
ssh beryllium "rm -I storage/movies/Infinity/*"
# Kill ssh agent
kill $SSH_AGENT_PID
fi