From 7e1bb2a73e662fca932a517216bf3a288abd59b5 Mon Sep 17 00:00:00 2001 From: Djan <> Date: Tue, 12 Oct 2021 16:42:22 +0200 Subject: [PATCH] adding bobapassphrase to set passphrase for repos passphrase is deleted from memory when terminal is closed deleting "BORG_PASSPHRASE" from bobadeleter,bobagrepdeleter,bobarenamer --- borgaliasandfunctions.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/borgaliasandfunctions.txt b/borgaliasandfunctions.txt index be85f6c..31c1390 100644 --- a/borgaliasandfunctions.txt +++ b/borgaliasandfunctions.txt @@ -95,6 +95,13 @@ function DirExists { fi } +function bobapassphrase { + stty -echo + read -p "Enter borg passphrase : " BORG_PASSPHRASE + stty echo + echo "" + export BORG_PASSPHRASE +} ############################################################################### # list and infos functions @@ -335,8 +342,6 @@ function bobadeleter { sed -i '1s/^/borg delete -v .::/' $file sed -i '1s/^/\n/' $file - sed -i '1s/^/export BORG_PASSPHRASE=\"\"\n/' $file - sed -i '1s/^/#Quick and dirty fix for repo with passphrase\n/' $file sed -i '1s/^/\n/' $file sed -i '1s/^/#Watch out you'\''re doing, there won'\''t be other confirmation\n/' $file sed -i '1s/^/\n/' $file @@ -361,8 +366,6 @@ function bobagrepdeleter { sed -i 's/^/#borg delete -v .::/' $file sed -i '1s/^/\n/' $file - sed -i '1s/^/export BORG_PASSPHRASE=\"\"\n/' $file - sed -i '1s/^/#Quick and dirty fix for repo with passphrase\n/' $file sed -i '1s/^/\n/' $file sed -i '1s/^/#Watch out you'\''re doing, there won'\''t be other confirmation.\n/' $file sed -i '1s/^/#Just uncomment lines you want to delete and save your file.\n/' $file @@ -404,8 +407,6 @@ function bobarenamer { sed -i '1s/^/\n/' $script sed -i '1s/^/\n/' $script - sed -i '1s/^/export BORG_PASSPHRASE=\"\"\n/' $script - sed -i '1s/^/#Quick and dirty fix for repo with passphrase\n/' $script sed -i '1s/^/\n/' $script sed -i '1s/^/#Modifications in this file will be applied\, comment all to cancel\.\n/' $script sed -i '1s/^/### BORG RENAMER ###\n/' $script