home · contact · privacy
Improve setup scripts.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 8 May 2019 18:28:35 +0000 (20:28 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 8 May 2019 18:28:35 +0000 (20:28 +0200)
all_new_2018/borg.sh
buster/setup_scripts/setup_eeepc.sh

index 1be74bb13f0730d5366378d7e77f5795bbaf128b..c518c8b15355a36b11c90c9894b7a61d3782bc05 100755 (executable)
@@ -16,9 +16,11 @@ usage() {
 }
 
 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: "
index a7add59929cf920ea7b574fcd627eb0998420dd3..c4c40251b5b040d46e1bec42ed14a4e9692b1233 100755 (executable)
@@ -61,6 +61,7 @@ if [ "${HOME_DIR_EXISTS}" -eq 0 ]; then
     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}"