]> git.sur5r.net Git - bacula/bacula/blob - gui/bweb/install_bweb
Update install script
[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=root
20 HTTP_GROUP=root
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 echo '$VAR1 = { template_dir => "${SHARE_DIR}/bweb/tpl" };' > /etc/bacula/bweb.conf
46 chown ${HTTP_USER} /etc/bacula/bweb.conf
47
48 # copy the bweb template file
49 if [ ! -d ${SHARE_DIR}/bweb/tpl ] ; then
50    mkdir -p ${SHARE_DIR}/bweb/tpl
51 fi
52 install -m 644 -o root -g root  tpl/*.tpl ${SHARE_DIR}/bweb/tpl
53
54 # copy the bweb graphics elements (bweb elements must reside in /bweb)
55 if [ ! -d ${WEB_DIR} ] ; then
56    mkdir ${WEB_DIR}/bweb
57 fi
58 install -m 644 -o root -g root  html/*.{js,png,css,gif,ico} ${WEB_DIR}/bweb
59
60 # done !