aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-09-13 18:19:51 +0200
committerRasmus Steinke <rasi@xssn.at>2015-09-13 18:19:51 +0200
commitd0f16247202cc6d7082698db2d3128cb92d4708e (patch)
tree4f47904a46ecec6eed85277ec08971fa24a74d03
parentda232fb8b96cf3de4bfb1cd9fbb2946ef0d6e640 (diff)
downloadrofi-pass-d0f16247202cc6d7082698db2d3128cb92d4708e.tar.gz
fix url to passed
-rw-r--r--README.md5
-rw-r--r--passed51
2 files changed, 1 insertions, 55 deletions
diff --git a/README.md b/README.md
index 7f03ddf..0d46f9f 100644
--- a/README.md
+++ b/README.md
@@ -66,7 +66,4 @@ Also included is an import script for keepass2 databases. It's the same script t
## Alternative
jreinert has written a roughly compatible tool to rofi-pass. It has less features, but definately saner code.
-Also he provided a nice little script called `passed` to change your fieldnames. [autopass](https://github.com/jreinert/autopass)
-
-I provide a copy of the script in this repository, just in case.
-Usage is: passed 's/foo/bar'
+Also he provided a nice little script called `passed` to change your fieldnames. [autopass](https://github.com/jreinert/passed)
diff --git a/passed b/passed
deleted file mode 100644
index 5d5ff8b..0000000
--- a/passed
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env ruby
-
-# written by jreiner, mirror from
-# https://github.com/jreinert/autopass/blob/master/passed
-
-abort("usage: #{$PROGRAM_NAME} <sed options>") if ARGV.empty?
-
-sed_command = ['sed', *ARGV]
-PASS_DIR = ENV['PASSWORD_STORE_DIR'] || "#{ENV['HOME']}/.password-store"
-
-def keys(dir)
- key_file = "#{dir}/.gpg-id"
- return unless File.exist?(key_file)
- File.read(key_file).lines.map(&:chomp)
-end
-
-def each_entry_with_key(dir = PASS_DIR, keys = nil, &block)
- keys = keys(dir) || keys
- fail('no encryption keys found') unless keys
- Dir[File.join(dir, '*.gpg')].each do |entry|
- yield(entry, keys)
- end
-
- Dir[File.join(dir, '*/')].each do |subdir|
- each_entry_with_key(subdir, keys, &block)
- end
-end
-
-each_entry_with_key do |entry, keys|
- new_content = nil
- IO.popen(['gpg', '--batch', '-q', '-d', entry]) do |gpg|
- IO.popen(sed_command, 'w+') do |sed|
- sed.write gpg.read
- sed.close_write
- new_content = sed.read
- end
- end
-
- puts entry
- puts new_content
- puts 'overwrite? (y/N)'
- answer = STDIN.gets
- next unless answer && answer.chomp =~ /^y/i
-
- recipients = keys.map { |key| ['-r', key] }.flatten
- File.delete(entry)
- encrypt_cmd = ['gpg', '--batch', '-q', '-e', '-o', entry, *recipients]
- IO.popen(encrypt_cmd, 'w+') do |gpg|
- gpg.write(new_content)
- end
-end