]> git.sur5r.net Git - bacula/bacula/blob - gui/bweb/install_bweb
Update install_bweb
[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 if [ `whoami` != "root" ] ; then
23   echo "You must be root to run this script."
24   exit 1
25 fi
26
27 #
28 # Normally you should not need to change the following
29 #
30 # first, copy the bweb perl library into your PERL5 INC path
31 perl Makefile.PL
32 make install
33
34 # copy the bweb perl program to your cgi location
35 if [ ! -d ${CGI_BIN}/bweb ] ; then
36    mkdir -m 755 ${CGI_BIN}/bweb
37 fi
38 install -m 755 -o root -g root  cgi/*.pl ${CGI_BIN}/bweb
39
40 # get a config file
41 if [ ! -d /etc/bacula ] ; then
42    mkdir -m 755 /etc/bacula
43    chown root:bacula /etc/bacula
44 fi
45
46 # Setup a default /etc/bacula/bweb.conf
47 cat > /etc/bacula/bweb.conf <<END_OF_DATA
48 $VAR1 = bless( {
49   'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
50   'name' => undef,
51   'config_file' => '/etc/bacula/bweb.conf',
52   'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
53   'ach_list' => {
54      'S1_L80' => bless( {
55          'info' => {
56                      'drive' => 0,
57                      'io' => 0,
58                      'slot' => 0
59                    },
60          'name' => 'S1_L80',
61          'bweb' => undef,
62          'device' => '/dev/changer',
63          'drive' => [],
64          'debug' => 0,
65          'label' => {},
66          'precmd' => 'sudo',
67          'io' => [],
68          'mtxcmd' => '/usr/sbin/mtx',
69          'drive_name' => [
70                            'S1_L80_SDLT0',
71                            'S1_L80_SDLT1'
72                          ],
73          'slot' => []
74        }, 'Bweb::Autochanger' )
75    },
76   'password' => 'xxx',
77   'template_dir' => '${SHARE_DIR}/bweb/tpl',
78   'dbi' => 'DBI:mysql:database=bacula',
79   'error' => '',
80   'debug' => 0,
81   'user' => 'bacula',
82   'email_media' => 'xxxx@localhost'
83 }, 'Bweb::Config' );
84 END_OF_DATA
85
86 chown ${HTTP_USER} /etc/bacula/bweb.conf
87
88 # copy the bweb template file
89 if [ ! -d ${SHARE_DIR}/bweb/tpl ] ; then
90    mkdir -p ${SHARE_DIR}/bweb/tpl
91 fi
92 install -m 644 -o root -g root  tpl/*.tpl ${SHARE_DIR}/bweb/tpl
93
94 # copy the bweb graphics elements (bweb elements must reside in /bweb)
95 if [ ! -d ${WEB_DIR} ] ; then
96    mkdir ${WEB_DIR}/bweb
97 fi
98 install -m 644 -o root -g root  html/*.{js,png,css,gif,ico} ${WEB_DIR}/bweb
99
100 # done !