3 # start bweb with lighttpd
7 if [ -f $PWD/html/bweb.js ]; then
10 elif [ -f $PWD/../html/bweb.js ]; then
11 BWEBBASE=$(dirname $PWD)
13 elif [ -f $BASE/html/bweb.js ]; then
16 elif [ -f $BASE/../html/bweb.js ]; then
17 BWEBBASE=$(cd $BASE; dirname $(pwd))
20 echo "Can't determine bweb installation directory"
24 grep /etc/bacula/bweb.conf $BWEBBASE/lib/Bweb.pm > /dev/null
26 echo "Adjusting bweb.conf path"
27 sed -i~ "s:/etc/bacula/bweb.conf:$BWEBBASE/bweb.conf:" $BWEBBASE/lib/Bweb.pm
30 if [ ! -f $BWEBBASE/bweb.conf ]; then
31 echo "Making configuration template in $BWEBBASE/bweb.conf"
32 cat > $BWEBBASE/bweb.conf <<EOF
33 \$VAR1 = { template_dir => '$BWEBBASE/lang',
34 bconsole => 'bconsole -n',
35 fv_write_path => '/tmp/',
40 host=$(awk -F'"' '/bind/ { print $2 }' $BWEBBASE/script/httpd.conf)
41 port=$(awk '/port/ { print $3 }' $BWEBBASE/script/httpd.conf)
43 echo "Using bweb on $BWEBBASE, use firefox http://$host:$port"
46 if [ x$1 = x -o x$1 = xstart ]; then
47 lighttpd -f $BWEBBASE/script/httpd.conf
50 echo "Something is wrong with lighttpd, be sure that it is installed"
55 if [ x$1 = xstop ]; then