Debian Codegraph @

debian/bacula-console-qt.postinst

raw
1 #!/bin/sh
2
3 set -e
4
5 PKG_NAME="bacula-console-qt"
6 CONFIG="bat.conf"
7 TEMPLATE="/usr/share/bacula-common/defconfig/$CONFIG"
8 TARGET="/etc/bacula/$CONFIG"
9
10 case "$1" in
11 configure)
12 . /usr/share/bacula-common/common-functions.dpkg
13 readOrCreatePasswords
14
15 # create new bat.conf using the template
16 TMP_CONFIG="$(mktemp -p /tmp $PKG_NAME.conf.ucftmp-XXXXXXXXXX)"
17 chmod 640 "$TMP_CONFIG"
18 sed -e "s~@debian_basename@~$(hostname)~" \
19 -e "s~XXX_DIRPASSWORD_XXX~$DIRPASSWD~" \
20 "$TEMPLATE" > "$TMP_CONFIG"
21 chown root:bacula "$TMP_CONFIG"
22
23 # let ucf handle the conffile and register it
24 ucf --debconf-ok --three-way "$TMP_CONFIG" "$TARGET"
25 ucfr "$PKG_NAME" "$TARGET"
26 rm -f "$TMP_CONFIG"
27 ;;
28 esac
29
30 # dh_installdeb will replace this with shell code automatically
31 # generated by other debhelper scripts.
32
33 #DEBHELPER#
34
35 exit 0