In this example, bweb files are in /home/bacula/bweb
bacula:~$ cd bweb
-bacula:~/bweb$ sed -i "s:/etc/bacula/bweb.conf:$PWD/bweb.conf:" lib/Bweb.pm
-bacula:~/bweb$ cat > bweb.conf <<EOF
-\$VAR1 = { template_dir => '$PWD/lang',
- fv_write_path => '/tmp/',
- };
-EOF
# configure the database
bacula:~/bweb$ mysql bacula < script/bweb-mysql.sql
# You can start the web server from the bweb directory
bacula@localhost:~/bweb$ ./script/starthttp
- Using bweb on /home/eric/dev/git/gui/bweb, use firefox http://localhost:9180
+ Making configuration template in /home/bacula/bweb/bweb.conf
+ Adjusting bweb.conf path
+ Using bweb on /home/bacula/bweb, use firefox http://localhost:9180
2009-07-18 22:23:12: (log.c.75) server started
By default, only the loopback interface is binded, you can change that
in the bweb/script/httpd.conf file.
+You will have to configure bweb with your database and bconsole info, it
+can be done in the web interface.
+
################ FILE COPY (Full Apache methode) ###############
# you must get bweb svn files
exit 1
fi
+grep /etc/bacula/bweb.conf $BASE/lib/Bweb.pm > /dev/null
+if [ $? -eq 0 ]; then
+ echo "Adjusting bweb.conf path"
+ sed -i~ "s:/etc/bacula/bweb.conf:$BASE/bweb.conf:" $BASE/lib/Bweb.pm
+fi
+
+if [ ! -f $BASE/bweb.conf ]; then
+ echo "Making configuration template in $BASE/bweb.conf"
+ cat > $BASE/bweb.conf <<EOF
+\$VAR1 = { template_dir => '$PWD/lang',
+ fv_write_path => '/tmp/',
+ };
+EOF
+fi
+
host=$(awk -F'"' '/bind/ { print $2 }' $BWEBBASE/script/httpd.conf)
port=$(awk '/port/ { print $3 }' $BWEBBASE/script/httpd.conf)
echo "Using bweb on $BWEBBASE, use firefox http://$host:$port"
export BWEBBASE
-export PERL5LIB=$BWEBBASE/lib
-lighttpd -f $BWEBBASE/script/httpd.conf
+if [ x$1 = x -o x$1 = xstart ]; then
+ lighttpd -f $BWEBBASE/script/httpd.conf
+
+ if [ $? -ne 0 ]; then
+ echo "Something is wrong with lighttpd, be sure that it is installed"
+ exit $?
+ fi
+fi