diff --git a/mpbackup b/mpbackup index 748aab3..7112ec7 100644 --- a/mpbackup +++ b/mpbackup @@ -9,8 +9,14 @@ NAME = 'mpbackup' VERSION = '0.3.0' def set_restic_vars(config) - repo = config['repository'] - puts "Repository: #{repo}" + 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'] + else + error(1, 'No repository has been specified.') + end if config['password-file'] puts "Reading password from file #{config['password-file']} …" password = File.open(config['password-file'], &:gets).chomp