mirror of
https://codeberg.org/puppe/mpbackup.git
synced 2025-12-20 05:52:18 +01:00
Optionally read repository from file
This commit is contained in:
parent
9e3a9f27ff
commit
dc53973745
1 changed files with 8 additions and 2 deletions
8
mpbackup
8
mpbackup
|
|
@ -9,8 +9,14 @@ NAME = 'mpbackup'
|
||||||
VERSION = '0.3.0'
|
VERSION = '0.3.0'
|
||||||
|
|
||||||
def set_restic_vars(config)
|
def set_restic_vars(config)
|
||||||
|
if config['repository-file']
|
||||||
|
puts "Reading repository from file #{config['repository-file']} …"
|
||||||
|
repo = File.open(config['repository-file'], &:gets).chomp
|
||||||
|
elsif config['repository']
|
||||||
repo = config['repository']
|
repo = config['repository']
|
||||||
puts "Repository: #{repo}"
|
else
|
||||||
|
error(1, 'No repository has been specified.')
|
||||||
|
end
|
||||||
if config['password-file']
|
if config['password-file']
|
||||||
puts "Reading password from file #{config['password-file']} …"
|
puts "Reading password from file #{config['password-file']} …"
|
||||||
password = File.open(config['password-file'], &:gets).chomp
|
password = File.open(config['password-file'], &:gets).chomp
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue