#!/bin/sh # # Change the following four environment variables to suit your system # # Root directory of web files # WEB_DIR=/srv/www/htdocs # # share directory for programs # SHARE_DIR=/usr/share # # cgi_bin location for web server # CGI_BIN=/srv/www/cgi-bin # # Userid the web server is running under # HTTP_USER=wwwrun HTTP_GROUP=www if [ `whoami` != "root" ] ; then echo "You must be root to run this script." exit 1 fi # # Normally you should not need to change the following # # first, copy the bweb perl library into your PERL5 INC path perl Makefile.PL make install # copy the bweb perl program to your cgi location if [ ! -d ${CGI_BIN}/bweb ] ; then mkdir -m 755 ${CGI_BIN}/bweb fi install -m 755 -o root -g root cgi/*.pl ${CGI_BIN}/bweb # get a config file if [ ! -d /etc/bacula ] ; then mkdir -m 755 /etc/bacula chown root:bacula /etc/bacula fi # Setup a default /etc/bacula/bweb.conf cat > /etc/bacula/bweb.conf < '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf', 'name' => undef, 'config_file' => '/etc/bacula/bweb.conf', 'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf', 'ach_list' => { 'S1_L80' => bless( { 'info' => { 'drive' => 0, 'io' => 0, 'slot' => 0 }, 'name' => 'S1_L80', 'bweb' => undef, 'device' => '/dev/changer', 'drive' => [], 'debug' => 0, 'label' => {}, 'precmd' => 'sudo', 'io' => [], 'mtxcmd' => '/usr/sbin/mtx', 'drive_name' => [ 'S1_L80_SDLT0', 'S1_L80_SDLT1' ], 'slot' => [] }, 'Bweb::Autochanger' ) }, 'password' => 'xxx', 'template_dir' => '${SHARE_DIR}/bweb/tpl', 'dbi' => 'DBI:mysql:database=bacula', 'error' => '', 'debug' => 0, 'user' => 'bacula', 'email_media' => 'xxxx@localhost' }, 'Bweb::Config' ); END_OF_DATA chown ${HTTP_USER} /etc/bacula/bweb.conf # copy the bweb template file if [ ! -d ${SHARE_DIR}/bweb/tpl ] ; then mkdir -p ${SHARE_DIR}/bweb/tpl fi install -m 644 -o root -g root tpl/*.tpl ${SHARE_DIR}/bweb/tpl # copy the bweb graphics elements (bweb elements must reside in /bweb) if [ ! -d ${WEB_DIR} ] ; then mkdir ${WEB_DIR}/bweb fi install -m 644 -o root -g root html/*.{js,png,css,gif,ico} ${WEB_DIR}/bweb # done !