updated on Sat Jan 21 20:03:50 UTC 2012
[aur-mirror.git] / bacula / bacula.install
blob9b8a3669a36dd6b40113364008266e1e14896504
1 post_install() {
2   if [ -z "`grep '^bacula::' /etc/group`" ]; then
3     echo "Adding bacula system group... "
4     groupadd -g 73 bacula >& /dev/null
5   fi
7   if [ -z "`grep '^bacula::' /etc/passwd`" ]; then
8     echo "Adding bacula system user... "
9     useradd -u 73 -c "Bacula Daemon" -d / -g bacula -s /bin/false bacula
10   fi
12   echo "Locking Bacula User Account..."
13   passwd -l bacula &>/dev/null
15   post_upgrade
18 post_upgrade() {
20 cat << EOM
22 Note:
23 ==> Please don't forget to config your MySQL database for the program.
24 ==>
25 ==>  1. If you have not init your MySQL DB yet, run mysql_install_db.
26 ==>  2. Run /etc/bacula/scripts/grant_mysql_privileges. This script creates database user
27 ==>     'bacula' with unrestricted rights to the bacula's database. The
28 ==>     script create  user is without any password. You may want to edit
29 ==>     the script before run it.
30 ==>  3. Run /etc/bacula/scripts/create_mysql_database to create the Database
31 ==>     Bacula.
32 ==>  4. Run /etc/bacula/scripts/make_mysql_tables to create tables used by bacula.
34 ==> The archive directory is: /var/cache/bacula
36 ==> Bacula's offical website : http://www.bacula.org
38 EOM
41 post_remove() {
42   echo "Removing Bacula's system users..."
43   userdel bacula &> /dev/null
44   groupdel bacula &> /dev/null
47 op=$1
48 shift
49 [ "$(type -t "$op")" = "function" ] && $op "$@"