postinst is in open-infrastructure-container-tools 20180218-2.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | #!/bin/sh
set -e
CONFFILE="/etc/default/container-tools"
Install ()
{
	DEFAULT="${1}"
	TARGET="${2}"
	mkdir -p "${DEFAULT}"
	mkdir -p "${TARGET}"
	if [ "${TARGET}" != "${DEFAULT}" ]
	then
		if [ -h "${DEFAULT}" ]
		then
			rm -f "${DEFAULT}"
			ln -s "${TARGET}" "${DEFAULT}"
		else
			if [ -e "${DEFAULT}" ] && find "${DEFAULT}" -maxdepth 0 -empty > /dev/null 2>&1
			then
				rmdir "${DEFAULT}"
				ln -s "${TARGET}" "${DEFAULT}"
			fi
		fi
	fi
	if ! dpkg-statoverride --list "${DEFAULT}" > /dev/null 2>&1 &&
	   ! dpkg-statoverride --list "${TARGET}" > /dev/null 2>&1
	then
		chmod 0700 "${TARGET}"
		chown root:root "${TARGET}"
		chmod 0700 "${DEFAULT}"
		chown root:root "${DEFAULT}"
	fi
}
case "${1}" in
	configure)
		update-alternatives --quiet --install /usr/share/container-tools/scripts/default container-tools_script /usr/share/container-tools/scripts/debootstrap 1000
		update-alternatives --quiet --install /usr/share/container-tools/scripts/default container-tools_script /usr/share/container-tools/scripts/curl 2000
		update-alternatives --quiet --install /usr/share/container-tools/scripts/default container-tools_script /usr/share/container-tools/scripts/progress-linux 3000
		update-alternatives --quiet --install /usr/share/container-tools/scripts/default container-tools_script /usr/share/container-tools/scripts/debian 4000
		. /usr/share/debconf/confmodule
		db_get open-infrastructure-container-tools/machines
		MACHINES="${RET:-/var/lib/machines}" # string (w/o empty)
		db_get open-infrastructure-container-tools/config
		CONFIG="${RET:-/etc/container-tools/config}" # string (w/o empty)
		db_get open-infrastructure-container-tools/debconf
		DEBCONF="${RET:-/etc/container-tools/debconf}" # string (w/o empty)
		db_get open-infrastructure-container-tools/hooks
		HOOKS="${RET:-/etc/container-tools/hooks}" # string (w/o empty)
		db_get open-infrastructure-container-tools/keys
		KEYS="${RET:-/etc/container-tools/keys}" # string (w/o empty)
		db_get open-infrastructure-container-tools/cache
		CACHE="${RET:-/var/cache/container-tools}" # string (w/o empty)
		db_get open-infrastructure-container-tools/script
		SCRIPT="${RET:-debian}" # string (w/o empty)
		db_get open-infrastructure-container-tools/irc
		IRK_TARGETS="${RET}" # string (w/ empty)
		db_stop
		Install "/var/lib/machines" "${MACHINES}"
		Install "/etc/container-tools/config" "${CONFIG}"
		Install "/etc/container-tools/debconf" "${DEBCONF}"
		Install "/etc/container-tools/hooks" "${HOOKS}"
		Install "/etc/container-tools/keys" "${KEYS}"
		Install "/var/cache/container-tools" "${CACHE}"
		update-alternatives --quiet --set container-tools_script "/usr/share/container-tools/scripts/${SCRIPT}"
		if [ ! -e "${CONFFILE}" ]
		then
cat > "${CONFFILE}" << EOF
# /etc/default/container-tools
IRK_TARGETS="${IRK_TARGETS}"
EOF
		fi
		cp -a -f "${CONFFILE}" "${CONFFILE}.tmp"
		# If the admin deleted or commented some variables but then set
		# them via debconf, (re-)add them to the config file.
		test -z "${IRK_TARGETS}" || \
			grep -Eq '^ *IRK_TARGETS=' "${CONFFILE}" || \
			echo "IRK_TARGETS=" >> "${CONFFILE}"
		sed -e "s|^ *IRK_TARGETS=.*|IRK_TARGETS=\"${IRK_TARGETS}\"|" \
		< "${CONFFILE}" > "${CONFFILE}.tmp"
		mv -f "${CONFFILE}.tmp" "${CONFFILE}"
		if [ -x /sbin/sysctl ]
		then
			sysctl -q -p /etc/sysctl.d/zz-container-tools.conf
		fi
		;;
	abort-upgrade|abort-remove|abort-deconfigure)
		;;
	*)
		echo "postinst called with unknown argument \`${1}'" >&2
		exit 1
		;;
esac
# Automatically added by dh_installsystemd/11.1.4ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	# This will only remove masks created by d-s-h on package removal.
	deb-systemd-helper unmask 'container-auto.service' >/dev/null || true
	# was-enabled defaults to true, so new installations run enable.
	if deb-systemd-helper --quiet was-enabled 'container-auto.service'; then
		# Enables the unit on first installation, creates new
		# symlinks on upgrades if the unit file has changed.
		deb-systemd-helper enable 'container-auto.service' >/dev/null || true
	else
		# Update the statefile to add new symlinks (if any), which need to be
		# cleaned up on purge. Also remove old symlinks.
		deb-systemd-helper update-state 'container-auto.service' >/dev/null || true
	fi
fi
# End automatically added section
exit 0
 |