added credentials shortcut for rustic

This commit is contained in:
Steffen Vogel 2016-04-03 13:10:10 +02:00
parent eef4183c0f
commit 0983de6a96
2 changed files with 13 additions and 0 deletions

View file

@ -94,3 +94,14 @@ function aws() {
AWS_SECRET_ACCESS_KEY=$(sed -En 's/^Secret-Key: (.*)/\1/p' <<< "$PASS") \
$AWS $@
}
function restic() {
local PASS=$(pass providers/aws)
local RESTIC=$(which restic)
# Start original restic executable with short-lived keys
AWS_ACCESS_KEY_ID=$(sed -En 's/^Access-Key: (.*)/\1/p' <<< "$PASS") \
AWS_SECRET_ACCESS_KEY=$(sed -En 's/^Secret-Key: (.*)/\1/p' <<< "$PASS") \
RESTIC_PASSWORD="$(pass static-3)" \
$RESTIC $@
}

View file

@ -49,5 +49,7 @@ else
export EDITOR=vim
fi
export RESTIC_REPOSITORY="s3://s3.amazonaws.com/stv0g-restic"
export DEBEMAIL="post@steffenvogel.de"
export DEBFULLNAME="Steffen Vogel"