From: Eric Bollengier Date: Wed, 19 Aug 2009 10:57:35 +0000 (+0200) Subject: Add BWEBCONF env variable to specify the bweb.conf path without X-Git-Tag: Release-5.0.0~332^2~11^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5c7f77c78f04f2a6267a04e7d3d48cfc36f1f256;p=bacula%2Fbacula Add BWEBCONF env variable to specify the bweb.conf path without touching the Bweb.pm file with lighttpd --- 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 <