1 # This is appended to packaging/deb/amanda-backup-*.postinst
4 # Note: this script needs to do the same things in all maintainer
5 # script cases: configure, abort-remove, abort-upgrade.
7 LOGFILE=`mktemp /tmp/amanda-postinst.log.XXXXXXXXXXX`
9 echo "Unable to create log file!"
12 amanda_user=amandabackup
14 AMANDAHOMEDIR=%%AMANDAHOMEDIR%%
18 INSTALL_LOG="${LOGDIR}/install.log"
23 AMANDATES=${SYSCONFDIR}/amandates
24 encoder=`{ command -v base64 2>/dev/null; } || { command -v uuencode 2>/dev/null; }`
26 # ---------- Common functions ------------
28 %%POST_INST_FUNCTIONS%%
30 # -------- End Common functions ----------
32 check_xinetd "amanda${pkg_type}"
34 0) backup_xinetd "amanda${pkg_type}"
35 install_xinetd "amanda${pkg_type}"
37 1) install_xinetd "amanda${pkg_type}" ;;
38 2) logger "Xinetd config not installed: either xinetd config is not present or xinetd.d is a file." ;;
39 *) logger "bad return from check_xinetd"
40 cat ${LOGFILE} >> ${INSTALL_LOG}
45 # amanda${pkg_type} should not have the amanda${other_pkg_type} xinetd installed.
46 check_xinetd "amanda${other_pkg_type}"
48 0) backup_xinetd "amanda${other_pkg_type}" ;;
51 check_superserver_running "xinetd"
52 [ "$?" = "0" ] && action=restart || action=start
56 create_ampassphrase || \
57 logger "Info: amcryptsimple and amcrpyt will not work until .am_passphrase is created"
60 logger "Info: amcrypt will not work until keys are created."
61 # Checks permissions, but only tries decrypting if both .am_passphrase
62 # and .gnupg/am_key.gpg exist.
65 check_amandahosts_entry root amindexd amidxtaped
66 check_amandahosts_entry ${amanda_user} amdump
67 check_amandahosts_perms
68 create_ssh_key ${pkg_type}
69 if [ "${pkg_type}" = "server" ]; then
70 create_ssh_key ${other_pkg_type}
77 logger "Amanda ${pkg_type} installation complete."
78 cat $LOGFILE >> $INSTALL_LOG && {
80 echo "Amanda installation log can be found in '${INSTALL_LOG}'.";
82 echo "Amanda installation log can be found in '${LOGFILE}'.";