mirror of
https://codeberg.org/puppe/mpbackup.git
synced 2025-12-19 21:42:17 +01:00
Read password without trailing \n (newline)
This commit is contained in:
parent
95d13588ba
commit
3a9c1d106f
1 changed files with 1 additions and 1 deletions
2
mpbackup
2
mpbackup
|
|
@ -39,7 +39,7 @@ def do_backup(config)
|
||||||
puts "Repository: #{ENV['RESTIC_REPOSITORY']}"
|
puts "Repository: #{ENV['RESTIC_REPOSITORY']}"
|
||||||
if config['password-file']
|
if config['password-file']
|
||||||
puts "Reading password from file #{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
|
else
|
||||||
ENV['RESTIC_PASSWORD'] = STDIN.getpass('Please put in your restic password: ')
|
ENV['RESTIC_PASSWORD'] = STDIN.getpass('Please put in your restic password: ')
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue