summaryrefslogtreecommitdiff
path: root/community/bacula/bacula.install
diff options
context:
space:
mode:
Diffstat (limited to 'community/bacula/bacula.install')
-rw-r--r--community/bacula/bacula.install49
1 files changed, 49 insertions, 0 deletions
diff --git a/community/bacula/bacula.install b/community/bacula/bacula.install
new file mode 100644
index 000000000..9b8a3669a
--- /dev/null
+++ b/community/bacula/bacula.install
@@ -0,0 +1,49 @@
+post_install() {
+ if [ -z "`grep '^bacula::' /etc/group`" ]; then
+ echo "Adding bacula system group... "
+ groupadd -g 73 bacula >& /dev/null
+ fi
+
+ if [ -z "`grep '^bacula::' /etc/passwd`" ]; then
+ echo "Adding bacula system user... "
+ useradd -u 73 -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 "$@"