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 # You can, in general, execute this file multiple times. However, if
7 # you edit certain of the installed files, your changes might be lost.
8 # This script will not overwrite any installed /etc/bacula/bweb.conf
10 # Configuration directory for bweb
13 # Root directory of web files
15 WEB_DIR=/srv/www/htdocs
17 # share directory for programs
21 # cgi_bin location for web server
23 CGI_BIN=/srv/www/cgi-bin
25 # Userid the web server is running under
30 # Bacula database name and password
33 EMAIL_ADDR="xxx@localhost"
36 if [ `whoami` != "root" ] ; then
37 echo "You must be root to run this script."
42 # Normally you should not need to change the following
44 # first, copy the bweb perl library into your PERL5 INC path
45 sed -i "s!/etc/bacula!${CONF_DIR}!" lib/Bweb.pm
49 # copy the bweb perl program to your cgi location
50 if [ ! -d ${CGI_BIN}/bweb ] ; then
51 mkdir -m 755 ${CGI_BIN}/bweb
53 install -m 755 -o root -g root cgi/*.pl ${CGI_BIN}/bweb
56 if [ ! -d ${CONF_DIR} ] ; then
57 mkdir -m 755 ${CONF_DIR}
58 chown root:bacula ${CONF_DIR}
61 # Setup a default ${CONF_DIR}/bweb.conf
62 if [ ! -e ${CONF_DIR}/bweb.conf ] ; then
63 cat > ${CONF_DIR}/bweb.conf <<END_OF_DATA
65 'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
67 'config_file' => '${CONF_DIR}/bweb.conf',
68 'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
78 'device' => '/dev/changer',
90 }, 'Bweb::Autochanger' )
92 'password' => '${DB_PW}',
93 'template_dir' => '${SHARE_DIR}/bweb/tpl',
95 'dbi' => 'DBI:mysql:database=bacula',
99 'email_media' => '${EMAIL_ADDR}'
104 chown ${HTTP_USER} ${CONF_DIR}/bweb.conf
106 # copy the bweb template file
107 if [ ! -d ${SHARE_DIR}/bweb/tpl/en ] ; then
108 mkdir -p ${SHARE_DIR}/bweb/tpl/{en,fr,es}
110 install -m 644 -o root -g root lang/en/tpl/*.tpl ${SHARE_DIR}/bweb/tpl/en
111 install -m 644 -o root -g root lang/es/tpl/*.tpl ${SHARE_DIR}/bweb/tpl/es
112 install -m 644 -o root -g root lang/fr/tpl/*.tpl ${SHARE_DIR}/bweb/tpl/fr
114 # copy the bweb graphics elements (bweb elements must reside in /bweb)
115 if [ ! -d ${WEB_DIR}/bweb ] ; then
116 mkdir -p ${WEB_DIR}/bweb
118 install -m 644 -o root -g root html/*.{js,png,css,gif,ico,html} ${WEB_DIR}/bweb
121 echo "Please edit ${CONF_DIR}/bweb.conf and ensure that all the paths to"
122 echo " the various programs and files such as bconsole, bconsole.conf"
123 echo " are correct, and that the DBI driver is correct (default mysql)"
124 echo " and has the right password for your DB"
126 echo "You have to load sql scripts (in bweb/script) to your database with"
127 echo " something like :"
128 echo " root# mysql bacula < script/bweb-mysql.sql"
130 echo " postgres# echo 'CREATE PROCEDURAL LANGUAGE plpgsql;' | psql bacula"
131 echo " postgres# psql -U bacula bacula < script/bweb/bweb-postgresql.sql"