3 LOGFILE=`mktemp /tmp/amanda-client-postinstall.log.XXXXXXXXXXX`
5 echo "Unable to mktemp!" 1>&2
8 amanda_user=amandabackup; export amanda_user
9 amanda_group=disk; export amanda_group
10 # BASEDIR is set by either in pkginfo, or if not set, by pkgadd at installtime.
11 # Unfortunately, it messes things up to have basedir="/".
12 [ "x${BASEDIR}" = "x/" ] && basedir="" || basedir=${BASEDIR}
13 AMANDAHOMEDIR="${basedir}%%AMANDAHOMEDIR%%"; export AMANDAHOMEDIR
15 arch=%%ARCH%%; export arch
16 LOGDIR="${basedir}%%LOGDIR%%"; export LOGDIR
17 INSTALL_LOG="${LOGDIR}/install.log"; export INSTALL_LOG
18 SYSCONFDIR="${basedir}/etc"; export SYSCONFDIR
19 SBINDIR="${basedir}/usr/sbin"; export SBINDIR
22 AMANDATES=${SYSCONFDIR}/amandates; export AMANDATES
23 # uuencode is still standard on sol10, but haven't checked sol 11.
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 ----------
34 if [ "$rel" = "5.8" ]; then
35 check_inetd "amandaclient"
37 0) backup_inetd "amandaclient"
38 install_inetd "amandaclient"
40 1) install_inetd "amandaclient" ;;
41 2) logger "Error: Amanda service not installed because inetd config was not found: either inetd config is not present or inetd is a directory." ;;
43 # Amanda clients should not have the server xinetd installed.
44 check_inetd "amandaserver"
46 0) backup_inetd "amandaserver" ;;
50 # Solaris 10+ uses smf, but we can't differentiate server from client, all
51 # entries end up named "amanda"
54 0) backup_smf || logger "Warning: Backup of existing service failed. continuing..."
55 install_smf "amandaclient" || \
56 logger "Warning: Amanda service not installed."
58 1) install_smf "amandaclient" ;;
64 create_ampassphrase || \
65 logger "Info: amcryptsimple and amcrpyt will not work until .am_passphrase is created"
68 logger "Info: amcrypt will not work until keys are created."
69 # Checks permissions, but only tries decrypting if both .am_passphrase
70 # and .gnupg/am_key.gpg exist.
73 check_amandahosts_entry root amindexd amidxtaped
74 check_amandahosts_entry ${amanda_user} amdump
75 check_amandahosts_perms
82 logger "Amanda installation complete."
83 exit_msg="Amanda installation log can be found in '${INSTALL_LOG}'."
84 cat $LOGFILE >> $INSTALL_LOG && {
86 echo "${exit_msg} '${INSTALL_LOG}'."
88 echo "${exit_msg} $LOGFILE."