]> git.sur5r.net Git - bacula/bacula/blob - gui/bweb/install_bweb
Spelling
[bacula/bacula] / gui / bweb / install_bweb
1 #!/bin/sh
2 #
3 # Change the following four environment variables to suit your system
4 #
5 # Root directory of web files       
6 #
7 WEB_DIR=/srv/www/htdocs 
8 #
9 # share directory for programs
10 #
11 SHARE_DIR=/usr/share
12 #
13 # cgi_bin location for web server
14 #
15 CGI_BIN=/srv/www/cgi-bin
16 #
17 # Userid the web server is running under
18 #
19 HTTP_USER=wwwrun
20 HTTP_GROUP=www
21
22 # Bacula database name and password
23 DB=bacula
24 DB_PW=""
25 EMAIL_ADDR="xxx@localhost"
26 MTX="/sbin/mtx"
27
28 if [ `whoami` != "root" ] ; then
29   echo "You must be root to run this script."
30   exit 1
31 fi
32
33 #
34 # Normally you should not need to change the following
35 #
36 # first, copy the bweb perl library into your PERL5 INC path
37 perl Makefile.PL
38 make install
39
40 # copy the bweb perl program to your cgi location
41 if [ ! -d ${CGI_BIN}/bweb ] ; then
42    mkdir -m 755 ${CGI_BIN}/bweb
43 fi
44 install -m 755 -o root -g root  cgi/*.pl ${CGI_BIN}/bweb
45
46 # get a config file
47 if [ ! -d /etc/bacula ] ; then
48    mkdir -m 755 /etc/bacula
49    chown root:bacula /etc/bacula
50 fi
51
52 # Setup a default /etc/bacula/bweb.conf
53 cat > /etc/bacula/bweb.conf <<END_OF_DATA
54 \$VAR1 = bless( {
55   'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
56   'name' => undef,
57   'config_file' => '/etc/bacula/bweb.conf',
58   'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
59   'ach_list' => {
60      'S1_L80' => bless( {
61          'info' => {
62                      'drive' => 0,
63                      'io' => 0,
64                      'slot' => 0
65                    },
66          'name' => 'S1_L80',
67          'bweb' => undef,
68          'device' => '/dev/changer',
69          'drive' => [],
70          'debug' => 0,
71          'label' => {},
72          'precmd' => 'sudo',
73          'io' => [],
74          'mtxcmd' => '${MTX}',
75          'drive_name' => [
76                            'S1_L80_SDLT0',
77                            'S1_L80_SDLT1'
78                          ],
79          'slot' => []
80        }, 'Bweb::Autochanger' )
81    },
82   'password' => '${DB_PW}',
83   'template_dir' => '${SHARE_DIR}/bweb/tpl',
84   'dbi' => 'DBI:mysql:database=bacula',
85   'error' => '',
86   'debug' => 0,
87   'user' => '${DB}',
88   'email_media' => '${EMAIL_ADDR}'
89 }, 'Bweb::Config' );
90 END_OF_DATA
91
92 chown ${HTTP_USER} /etc/bacula/bweb.conf
93
94 # copy the bweb template file
95 if [ ! -d ${SHARE_DIR}/bweb/tpl ] ; then
96    mkdir -p ${SHARE_DIR}/bweb/tpl
97 fi
98 install -m 644 -o root -g root  tpl/*.tpl ${SHARE_DIR}/bweb/tpl
99
100 # copy the bweb graphics elements (bweb elements must reside in /bweb)
101 if [ ! -d ${WEB_DIR} ] ; then
102    mkdir ${WEB_DIR}/bweb
103 fi
104 install -m 644 -o root -g root  html/*.{js,png,css,gif,ico,html} ${WEB_DIR}/bweb
105
106 # done !