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 # Root directory of web files
12 WEB_DIR=/srv/www/htdocs
14 # share directory for programs
18 # cgi_bin location for web server
20 CGI_BIN=/srv/www/cgi-bin
22 # Userid the web server is running under
27 # Bacula database name and password
30 EMAIL_ADDR="xxx@localhost"
33 if [ `whoami` != "root" ] ; then
34 echo "You must be root to run this script."
39 # Normally you should not need to change the following
41 # first, copy the bweb perl library into your PERL5 INC path
45 # copy the bweb perl program to your cgi location
46 if [ ! -d ${CGI_BIN}/bweb ] ; then
47 mkdir -m 755 ${CGI_BIN}/bweb
49 install -m 755 -o root -g root cgi/*.pl ${CGI_BIN}/bweb
52 if [ ! -d /etc/bacula ] ; then
53 mkdir -m 755 /etc/bacula
54 chown root:bacula /etc/bacula
57 # Setup a default /etc/bacula/bweb.conf
58 if [ ! -e /etc/bacula/bweb.conf ] ; then
59 cat > /etc/bacula/bweb.conf <<END_OF_DATA
61 'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
63 'config_file' => '/etc/bacula/bweb.conf',
64 'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
74 'device' => '/dev/changer',
86 }, 'Bweb::Autochanger' )
88 'password' => '${DB_PW}',
89 'template_dir' => '${SHARE_DIR}/bweb/tpl',
90 'dbi' => 'DBI:mysql:database=bacula',
94 'email_media' => '${EMAIL_ADDR}'
99 chown ${HTTP_USER} /etc/bacula/bweb.conf
101 # copy the bweb template file
102 if [ ! -d ${SHARE_DIR}/bweb/tpl ] ; then
103 mkdir -p ${SHARE_DIR}/bweb/tpl
105 install -m 644 -o root -g root tpl/*.tpl ${SHARE_DIR}/bweb/tpl
107 # copy the bweb graphics elements (bweb elements must reside in /bweb)
108 if [ ! -d ${WEB_DIR} ] ; then
109 mkdir ${WEB_DIR}/bweb
111 install -m 644 -o root -g root html/*.{js,png,css,gif,ico,html} ${WEB_DIR}/bweb
114 echo "Please edit /etc/bweb.conf and ensure that all the paths to"
115 echo " the various programs and files such as bconsole, bconsole.conf"
116 echo " are correct, and that the DBI driver is correct (default mysql)"
117 echo " and has the right password for your DB"