[pkg-bacula-commits] [bacula] 06/09: manage bacula-console configs with ucf

Carsten Leonhardt leo at moszumanska.debian.org
Wed Jul 20 10:57:37 UTC 2016


This is an automated email from the git hooks/post-receive script.

leo pushed a commit to tag development/migrate-to-ucf-2012-06-07
in repository bacula.

commit 32f2f06eeed80edac2d277ab734fc94e40e98f5b
Author: Alexander Golovko <alexandro at ankalagon.ru>
Date:   Wed Jun 6 21:24:53 2012 +0400

    manage bacula-console configs with ucf
---
 debian/bacula-console.postinst | 27 ++++++++-------------------
 debian/bacula-console.postrm   | 20 +++++++++++++-------
 2 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/debian/bacula-console.postinst b/debian/bacula-console.postinst
index 319fe7b..50ec641 100644
--- a/debian/bacula-console.postinst
+++ b/debian/bacula-console.postinst
@@ -3,28 +3,17 @@
 set -e
 
 
-SRCDIR="/usr/share/bacula-common/defconfig"
-DSTDIR="/etc/bacula"
-CONFIG="bconsole.conf"
-
 . /usr/share/bacula-common/common-functions.dpkg
-readOrCreatePasswords
+
 
 case "$1" in
-    configure)
-	if [ ! -f $DSTDIR/$CONFIG ]; then
-		TARGET=$DSTDIR/$CONFIG
-	else
-		TARGET=$DSTDIR/$CONFIG.dist
-	fi
-
-	sed -e "s~@debian_hostname@~localhost~" \
-	-e s~XXX_DIRPASSWORD_XXX~$DIRPASSWD~ \
-		< $SRCDIR/$CONFIG > $TARGET
-
-	chown root:bacula $TARGET
-	chmod 640 $TARGET
-    ;;
+  configure)
+    CONFIG="/etc/bacula/bconsole.conf"
+    readOrCreatePasswords
+
+    install_config bacula-console "$CONFIG" "$2"
+    chown root:root "$CONFIG"
+    chmod 0640 "$CONFIG"
 esac
 
 
diff --git a/debian/bacula-console.postrm b/debian/bacula-console.postrm
index ed0794c..90d35dc 100644
--- a/debian/bacula-console.postrm
+++ b/debian/bacula-console.postrm
@@ -3,14 +3,20 @@
 set -e
 
 
-CONSOLE=/usr/sbin/bacula-console
-CFGDIR=/etc/bacula
-CFGFILE="bconsole.conf"
-
 case "$1" in
-	purge)
-		rm -f $CFGDIR/$CFGFILE.*
-	;;
+  purge)
+    CONFIG_FILES="/etc/bacula/bconsole.conf"
+
+    for CONF in $CONFIG_FILES; do
+      rm -f "$CONF" "$CONF.ucf-old" "$CONF.ucf-new" "$CONF.ucf-dist"
+
+      if which ucf >/dev/null; then
+        ucf --purge "$CONF"
+      fi
+      if which ucfr >/dev/null; then
+        ucfr --purge bacula-console "$CONF"
+      fi
+    done
 esac
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bacula/bacula.git



More information about the pkg-bacula-commits mailing list