diff --git a/mpbackup b/mpbackup index 97cddf2..967ed67 100644 --- a/mpbackup +++ b/mpbackup @@ -39,7 +39,7 @@ def do_backup(config) puts "Repository: #{ENV['RESTIC_REPOSITORY']}" if config['password-file'] puts "Reading password from file #{config['password-file']} …" - ENV['RESTIC_PASSWORD'] = File.open(config['password-file']) {|f| f.readline} + ENV['RESTIC_PASSWORD'] = File.open(config['password-file'], &:gets).chomp else ENV['RESTIC_PASSWORD'] = STDIN.getpass('Please put in your restic password: ') end