home
·
contact
·
privacy
projects
/
config
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Better passphrase management.
[config]
/
all_new_2018
/
borg.sh
diff --git
a/all_new_2018/borg.sh
b/all_new_2018/borg.sh
index 2c276bf27b090519709fca4054be43c9430a74d4..1be74bb13f0730d5366378d7e77f5795bbaf128b 100755
(executable)
--- a/
all_new_2018/borg.sh
+++ b/
all_new_2018/borg.sh
@@
-19,12
+19,14
@@
read_pw() {
eval $(ssh-agent)
echo "ssh-add"
ssh-add
eval $(ssh-agent)
echo "ssh-add"
ssh-add
- stty -echo
- printf "Borg passphrase: "
- read password
- stty echo
- printf "\n"
- export BORG_PASSPHRASE="${password}"
+ if [ "${#BORG_PASSPHRASE}" -eq 0 ]; then
+ stty -echo
+ printf "Borg passphrase: "
+ read password
+ stty echo
+ printf "\n"
+ export BORG_PASSPHRASE="${password}"
+ fi
}
if [ ! -f "${config_file}" ]; then
}
if [ ! -f "${config_file}" ]; then