3 # Change the following four environment variables to suit your system
4 # Note, the configuration below works on a stock SuSE 10.2 system
6 # Root directory of web files
8 WEB_DIR=/srv/www/htdocs
10 # share directory for programs
14 # cgi_bin location for web server
16 CGI_BIN=/srv/www/cgi-bin
18 # Userid the web server is running under
23 # Bacula database name and password
26 EMAIL_ADDR="xxx@localhost"
29 if [ `whoami` != "root" ] ; then
30 echo "You must be root to run this script."
35 # Normally you should not need to change the following
37 # first, copy the bweb perl library into your PERL5 INC path
41 # copy the bweb perl program to your cgi location
42 if [ ! -d ${CGI_BIN}/bweb ] ; then
43 mkdir -m 755 ${CGI_BIN}/bweb
45 install -m 755 -o root -g root cgi/*.pl ${CGI_BIN}/bweb
48 if [ ! -d /etc/bacula ] ; then
49 mkdir -m 755 /etc/bacula
50 chown root:bacula /etc/bacula
53 # Setup a default /etc/bacula/bweb.conf
54 cat > /etc/bacula/bweb.conf <<END_OF_DATA
56 'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
58 'config_file' => '/etc/bacula/bweb.conf',
59 'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
69 'device' => '/dev/changer',
81 }, 'Bweb::Autochanger' )
83 'password' => '${DB_PW}',
84 'template_dir' => '${SHARE_DIR}/bweb/tpl',
85 'dbi' => 'DBI:mysql:database=bacula',
89 'email_media' => '${EMAIL_ADDR}'
93 chown ${HTTP_USER} /etc/bacula/bweb.conf
95 # copy the bweb template file
96 if [ ! -d ${SHARE_DIR}/bweb/tpl ] ; then
97 mkdir -p ${SHARE_DIR}/bweb/tpl
99 install -m 644 -o root -g root tpl/*.tpl ${SHARE_DIR}/bweb/tpl
101 # copy the bweb graphics elements (bweb elements must reside in /bweb)
102 if [ ! -d ${WEB_DIR} ] ; then
103 mkdir ${WEB_DIR}/bweb
105 install -m 644 -o root -g root html/*.{js,png,css,gif,ico,html} ${WEB_DIR}/bweb