X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=gui%2Fbweb%2Finstall_bweb;h=02fd82eabbc194529932447229ea442075e8b837;hb=fc38e616ac9d15862d06718521fc458b6a722969;hp=694ecbb14eafefba33c490b2cebf5275b8c22fc7;hpb=53e295679c8b10851d269d7a3d7801cfbfdf8edc;p=bacula%2Fbacula diff --git a/gui/bweb/install_bweb b/gui/bweb/install_bweb index 694ecbb14e..02fd82eabb 100755 --- a/gui/bweb/install_bweb +++ b/gui/bweb/install_bweb @@ -1,6 +1,14 @@ #!/bin/sh # # Change the following four environment variables to suit your system +# Note, the configuration below works on a stock SuSE 10.2 system +# +# You can, in general, execute this file multiple times. However, if +# you edit certain of the installed files, your changes might be lost. +# This script will not overwrite any installed /etc/bacula/bweb.conf +# +# Configuration directory for bweb +CONF_DIR=/etc/bacula # # Root directory of web files # @@ -16,8 +24,14 @@ CGI_BIN=/srv/www/cgi-bin # # Userid the web server is running under # -HTTP_USER=root -HTTP_GROUP=root +HTTP_USER=wwwrun +HTTP_GROUP=www + +# Bacula database name and password +DB=bacula +DB_PW="" +EMAIL_ADDR="xxx@localhost" +MTX="/sbin/mtx" if [ `whoami` != "root" ] ; then echo "You must be root to run this script." @@ -28,6 +42,7 @@ fi # Normally you should not need to change the following # # first, copy the bweb perl library into your PERL5 INC path +sed -i "s!/etc/bacula!${CONF_DIR}!" lib/Bweb.pm perl Makefile.PL make install @@ -38,12 +53,54 @@ 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 +if [ ! -d ${CONF_DIR} ] ; then + mkdir -m 755 ${CONF_DIR} + chown root:bacula ${CONF_DIR} fi -echo '$VAR1 = { template_dir => "${SHARE_DIR}/bweb/tpl" };' > /etc/bacula/bweb.conf -chown ${HTTP_USER} /etc/bacula/bweb.conf + +# Setup a default ${CONF_DIR}/bweb.conf +if [ ! -e ${CONF_DIR}/bweb.conf ] ; then +cat > ${CONF_DIR}/bweb.conf < '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf', + 'name' => undef, + 'config_file' => '${CONF_DIR}/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' => '${MTX}', + 'drive_name' => [ + 'S1_L80_SDLT0', + 'S1_L80_SDLT1' + ], + 'slot' => [] + }, 'Bweb::Autochanger' ) + }, + 'password' => '${DB_PW}', + 'template_dir' => '${SHARE_DIR}/bweb/tpl', + 'dbi' => 'DBI:mysql:database=bacula', + 'error' => '', + 'debug' => 0, + 'user' => '${DB}', + 'email_media' => '${EMAIL_ADDR}' +}, 'Bweb::Config' ); +END_OF_DATA +fi + +chown ${HTTP_USER} ${CONF_DIR}/bweb.conf # copy the bweb template file if [ ! -d ${SHARE_DIR}/bweb/tpl ] ; then @@ -55,6 +112,20 @@ install -m 644 -o root -g root tpl/*.tpl ${SHARE_DIR}/bweb/tpl 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 +install -m 644 -o root -g root html/*.{js,png,css,gif,ico,html} ${WEB_DIR}/bweb + +echo " " +echo "Please edit ${CONF_DIR}/bweb.conf and ensure that all the paths to" +echo " the various programs and files such as bconsole, bconsole.conf" +echo " are correct, and that the DBI driver is correct (default mysql)" +echo " and has the right password for your DB" +echo " " +echo "You have to load sql scripts (in bweb/script) to your database with" +echo " something like :" +echo " root# mysql bacula < script/bweb-mysql.sql" +echo " or" +echo " postgres# echo 'CREATE PROCEDURAL LANGUAGE plpgsql;' | psql bacula" +echo " postgres# psql -U bacula -P passwd < script/bweb/bweb-postgresql.sql" +echo " " # done !