post_install() { if [ -z "`grep '^bacula::' /etc/group`" ]; then echo "Adding bacula system group... " groupadd -g 77 bacula >& /dev/null fi if [ -z "`grep '^bacula::' /etc/passwd`" ]; then echo "Adding bacula system user... " useradd -u 77 -c "Bacula Daemon" -d / -g bacula -s /bin/false bacula fi echo "Locking Bacula User Account..." passwd -l bacula &>/dev/null post_upgrade } post_upgrade() { cat << EOM Note: ==> Please don't forget to config your MySQL database for the program. ==> ==> 1. If you have not init your MySQL DB yet, run mysql_install_db. ==> 2. Run /etc/bacula/scripts/grant_mysql_privileges. This script creates database user ==> 'bacula' with unrestricted rights to the bacula's database. The ==> script create user is without any password. You may want to edit ==> the script before run it. ==> 3. Run /etc/bacula/scripts/create_mysql_database to create the Database ==> Bacula. ==> 4. Run /etc/bacula/scripts/make_mysql_tables to create tables used by bacula. ==> The archive directory is: /var/cache/bacula ==> Bacula's offical website : http://www.bacula.org EOM } post_remove() { echo "Removing Bacula's system users..." userdel bacula &> /dev/null groupdel bacula &> /dev/null } op=$1 shift [ "$(type -t "$op")" = "function" ] && $op "$@"