3 # Change the following four environment variables to suit your system
5 # Root directory of web files
7 WEB_DIR=/srv/www/htdocs
9 # share directory for programs
13 # cgi_bin location for web server
15 CGI_BIN=/srv/www/cgi-bin
17 # Userid the web server is running under
22 # Bacula database name and password
25 EMAIL_ADDR="xxx@localhost"
28 if [ `whoami` != "root" ] ; then
29 echo "You must be root to run this script."
34 # Normally you should not need to change the following
36 # first, copy the bweb perl library into your PERL5 INC path
40 # copy the bweb perl program to your cgi location
41 if [ ! -d ${CGI_BIN}/bweb ] ; then
42 mkdir -m 755 ${CGI_BIN}/bweb
44 install -m 755 -o root -g root cgi/*.pl ${CGI_BIN}/bweb
47 if [ ! -d /etc/bacula ] ; then
48 mkdir -m 755 /etc/bacula
49 chown root:bacula /etc/bacula
52 # Setup a default /etc/bacula/bweb.conf
53 cat > /etc/bacula/bweb.conf <<END_OF_DATA
55 'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
57 'config_file' => '/etc/bacula/bweb.conf',
58 'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
68 'device' => '/dev/changer',
80 }, 'Bweb::Autochanger' )
82 'password' => '${DB_PW}',
83 'template_dir' => '${SHARE_DIR}/bweb/tpl',
84 'dbi' => 'DBI:mysql:database=bacula',
88 'email_media' => '${EMAIL_ADDR}'
92 chown ${HTTP_USER} /etc/bacula/bweb.conf
94 # copy the bweb template file
95 if [ ! -d ${SHARE_DIR}/bweb/tpl ] ; then
96 mkdir -p ${SHARE_DIR}/bweb/tpl
98 install -m 644 -o root -g root tpl/*.tpl ${SHARE_DIR}/bweb/tpl
100 # copy the bweb graphics elements (bweb elements must reside in /bweb)
101 if [ ! -d ${WEB_DIR} ] ; then
102 mkdir ${WEB_DIR}/bweb
104 install -m 644 -o root -g root html/*.{js,png,css,gif,ico,html} ${WEB_DIR}/bweb