}
read_pw() {
- eval $(ssh-agent)
- echo "ssh-add"
- ssh-add
+ if [ "${#SSH_AGENT_PID}" -eq 0 ]; then
+ eval $(ssh-agent)
+ echo "ssh-add"
+ ssh-add
+ fi
if [ "${#BORG_PASSPHRASE}" -eq 0 ]; then
stty -echo
printf "Borg passphrase: "
printf "Secrets passphrase: "
read secrets_pass
stty echo
+ echo "" # newline so user knows their input return was accepted
echo "${secrets_pass}" | pmount /dev/"${secrets_dev}"
cp -a "${source_dir_secrets}" "${target_dir_secrets}"
chown -R plom:plom "${target_dir_secrets}"