aboutsummaryrefslogtreecommitdiff
path: root/scripts/pass-migrate.sh
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2020-12-24 00:06:27 +0530
committerAkshay Nair <phenax5@gmail.com>2020-12-24 00:06:27 +0530
commit865728068c965e066d0f8971c5b5ba26e12e7dce (patch)
treec16195f0a04cf7d004fe5b396255734f4d60bb00 /scripts/pass-migrate.sh
parent649ef5f225039e498358c3d056dfd7fcbc56f014 (diff)
downloadnixos-config-865728068c965e066d0f8971c5b5ba26e12e7dce.tar.gz
nixos-config-865728068c965e066d0f8971c5b5ba26e12e7dce.zip
Adds scripts and links scripts and wallpapers
Diffstat (limited to 'scripts/pass-migrate.sh')
-rwxr-xr-xscripts/pass-migrate.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/pass-migrate.sh b/scripts/pass-migrate.sh
new file mode 100755
index 0000000..01adab9
--- /dev/null
+++ b/scripts/pass-migrate.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+[[ $# != 2 ]] && echo "Usage: pass-migrate.sh <pass_dir> <key_file>" && exit 1;
+
+PASS_DIR="$1";
+KEY_FILE="$2";
+
+to_passnames() { sed -e 's/^[./]*//g' -e 's/\.gpg$//g'; }
+
+get_gpg_files() {
+ cd "$PASS_DIR" 2> /dev/null;
+ find . -regex '.*\.gpg';
+}
+
+get_gpg_files | to_passnames | while read key; do
+ pass=$(pass show "$key");
+ echo "$pass";
+done;
+