]> git.sur5r.net Git - bacula/bacula/blob - gui/debian/bweb.postinst
ebl add fv_write_path to default configuration
[bacula/bacula] / gui / debian / bweb.postinst
1 #!/bin/sh
2 set -e
3
4 . /usr/share/debconf/confmodule
5
6 db_version 2.0
7
8 if [ "$1" = "configure" ] ; then
9  if [ -f /etc/bweb/config ] ; then
10      echo "/etc/bweb/config have moved to /etc/bacula/bweb.conf"
11      echo "you can remove /etc/bweb"
12      [ ! -d /etc/bacula ] && mkdir /etc/bacula
13      cp -p /etc/bweb/config /etc/bacula/bweb.conf
14      sed -i 's!/etc/bweb/config!/etc/bacula/bweb.conf!' /etc/bacula/bweb.conf
15  fi
16
17  if [ ! -f /etc/bacula/bweb.conf ] ; then
18         echo '$VAR1 = { template_dir => "/usr/share/bweb/tpl", fv_write_path => "/var/spool/bweb" };' > /etc/bacula/bweb.conf
19
20         chown www-data:root /etc/bacula/bweb.conf
21         chmod 640 /etc/bacula/bweb.conf
22
23         chown www-data:root /var/spool/bweb
24         chmod 700 /var/spool/bweb
25         
26         echo
27         echo "If you are using postgresql, you have to load /usr/share/bweb/bweb-postgresql.sql in your database"
28
29         echo "postgres@localhost:~$ psql bacula < /usr/share/bweb/bweb-postgresql.sql"
30         echo 
31         echo "You can use user/passwd (see /etc/apache/conf.d/bweb.conf)"
32         echo "You have to reload your apache configuration"
33  fi
34 fi