Skip to content

Instantly share code, notes, and snippets.

@dkess
Created April 25, 2020 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkess/5943d96ce09fb120140058014cc1b205 to your computer and use it in GitHub Desktop.
Save dkess/5943d96ce09fb120140058014cc1b205 to your computer and use it in GitHub Desktop.
dkess's recovery script
#!/bin/bash
# gpg -o env -d env.gpg
# sudo systemd-run -p DynamicUser=1 -p PrivateTmp=1 --working-directory=/tmp --setenv=HOME=/tmp -p EnvironmentFile="$(realpath recovery.env)" --pty --wait --service-type=exec recovery.sh
set -euo pipefail
export GPG_TTY=$(tty)
gpg --import /dev/stdin <<< "$GPGKEY"
unset GPGKEY
pipx run b2 authorize-account
mkdir passwords
pipx run b2 sync "$B2_PATH" passwords
git clone gcrypt::"$(realpath passwords)" pgit
PASSWORD_STORE_DIR=pgit pass git --no-pager log --name-status HEAD^..HEAD
PASSWORD_STORE_DIR=pgit pass show test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment