From 5c7f77c78f04f2a6267a04e7d3d48cfc36f1f256 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 19 Aug 2009 12:57:35 +0200 Subject: [PATCH] Add BWEBCONF env variable to specify the bweb.conf path without touching the Bweb.pm file with lighttpd --- gui/bweb/lib/Bweb.pm | 7 ++++++- gui/bweb/script/httpd.conf | 3 ++- gui/bweb/script/starthttp | 7 +------ gui/bweb/technotes-3.0 | 5 +++++ 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index d0be07ebc9..31db71bdfc 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -1279,7 +1279,12 @@ use base q/Bweb::Gui/; use DBI; use POSIX qw/strftime/; -our $config_file='/etc/bacula/bweb.conf'; +our $config_file= '/etc/bacula/bweb.conf'; + +if ($ENV{BWEBCONF} && -f $ENV{BWEBCONF}) { + $config_file = $ENV{BWEBCONF}; +} + our $cur_id=0; =head1 VARIABLE diff --git a/gui/bweb/script/httpd.conf b/gui/bweb/script/httpd.conf index d67026a5c9..81793bc126 100644 --- a/gui/bweb/script/httpd.conf +++ b/gui/bweb/script/httpd.conf @@ -21,7 +21,8 @@ alias.url = ( "/cgi-bin/bweb/" => basedir + "/cgi/", ) setenv.add-environment = ( - "PERLLIB" => basedir + "/lib/" + "PERLLIB" => basedir + "/lib/", + "BWEBCONF" => basedir + "/bweb.conf" ) index-file.names = ( "index.html" ) diff --git a/gui/bweb/script/starthttp b/gui/bweb/script/starthttp index 5fab8bc942..dd5b088967 100755 --- a/gui/bweb/script/starthttp +++ b/gui/bweb/script/starthttp @@ -21,12 +21,6 @@ else exit 1 fi -grep /etc/bacula/bweb.conf $BWEBBASE/lib/Bweb.pm > /dev/null -if [ $? -eq 0 ]; then - echo "Adjusting bweb.conf path" - sed -i~ "s:/etc/bacula/bweb.conf:$BWEBBASE/bweb.conf:" $BWEBBASE/lib/Bweb.pm -fi - if [ ! -f $BWEBBASE/bweb.conf ]; then echo "Making configuration template in $BWEBBASE/bweb.conf" cat > $BWEBBASE/bweb.conf <