postinst is in epoptes 0.5.10-1.
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 | #!/bin/sh
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
# $1 = version of the package being upgraded.
install() {
if [ -f /etc/default/epoptes ]; then
. /etc/default/epoptes || true
fi
SOCKET_GROUP=${SOCKET_GROUP:-epoptes}
if ! getent group "$SOCKET_GROUP" >/dev/null; then
addgroup --system "$SOCKET_GROUP"
fi
if ! [ -f /etc/epoptes/server.key ] || ! [ -f /etc/epoptes/server.crt ]
then
# openssl leaves an .rnd file causing a lintian warning (bug #750099).
tmphome=$(mktemp -d)
# Generate a certificate that is valid since the Epoch,
# to work around wrong dates on clients with CMOS battery issues.
# faketime fails on launchpad, so also try without it.
HOME=$tmphome faketime '1970-01-01 00:00:00 UTC' \
openssl req -batch -x509 -nodes \
-newkey rsa:4096 -days $(($(date --utc +%s) / 86400 + 3652)) \
-keyout /etc/epoptes/server.key -out /etc/epoptes/server.crt ||
HOME=$tmphome openssl req -batch -x509 -nodes \
-newkey rsa:4096 -days $(($(date --utc +%s) / 86400 + 3652)) \
-keyout /etc/epoptes/server.key -out /etc/epoptes/server.crt
rm -rf "$tmphome"
chmod 600 /etc/epoptes/server.key
echo '
A new OpenSSL certificate has been generated for epoptes.
Please ensure that you transfer /etc/epoptes/server.crt
to your clients by issuing `epoptes-client -c` from your
regular workstations or from your LTSP chroots.' >&2
fi
}
case "$1" in
configure)
install "$2"
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
# Automatically added by dh_python2:
if which pycompile >/dev/null 2>&1; then
pycompile -p epoptes
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
if [ -x "/etc/init.d/epoptes" ]; then
update-rc.d epoptes defaults 30 >/dev/null
fi
if [ -x "/etc/init.d/epoptes" ] || [ -e "/etc/init/epoptes.conf" ]; then
invoke-rc.d epoptes start || exit $?
fi
fi
# End automatically added section
exit 0
|