From 2e3fe1be61e201e19e24655ada6b327573f10d1c Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 2 Oct 2007 07:28:29 +0000 Subject: [PATCH] ebl Checks if $HOME exists for default location of .brestore.conf git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5708 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/brestore/ReleaseNotes | 3 +++ gui/brestore/brestore.pl | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gui/brestore/ReleaseNotes b/gui/brestore/ReleaseNotes index 8924420792..723a1ebc47 100644 --- a/gui/brestore/ReleaseNotes +++ b/gui/brestore/ReleaseNotes @@ -1,5 +1,8 @@ Release Notes for brestore 2.2.0 +Version 2.2.5-1: + - Fix warning, thanks to Tuomas Jormola + Version 2.2.0-2: - cleanup brestore - update brestore_xxx only when job is in (T, f, A) diff --git a/gui/brestore/brestore.pl b/gui/brestore/brestore.pl index edb27f128b..fb6178ceef 100755 --- a/gui/brestore/brestore.pl +++ b/gui/brestore/brestore.pl @@ -3275,7 +3275,7 @@ sub HELP_MESSAGE exit 1; } -my $file_conf = "$ENV{HOME}/.brestore.conf" ; +my $file_conf = (exists $ENV{HOME})? "$ENV{HOME}/.brestore.conf" : undef ; my $batch_mod; GetOptions("conf=s" => \$file_conf, @@ -3283,6 +3283,11 @@ GetOptions("conf=s" => \$file_conf, "debug" => \$debug, "help" => \&HELP_MESSAGE) ; +if (! defined $file_conf) { + print STDERR "Could not detect default config and no config file specified\n"; + HELP_MESSAGE(); +} + my $p = new Pref($file_conf); if (! -f $file_conf) { -- 2.39.5