source: epoptes/trunk/fuentes/debian/epoptes.postinst @ 295

Last change on this file since 295 was 295, checked in by mabarracus, 4 years ago

copy trusty epoptes code

File size: 1.7 KB
Line 
1#!/bin/sh
2
3set -e
4
5# summary of how this script can be called:
6#        * <postinst> `configure' <most-recently-configured-version>
7#        * <old-postinst> `abort-upgrade' <new version>
8#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
9#          <new-version>
10#        * <postinst> `abort-remove'
11#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
12#          <failed-install-package> <version> `removing'
13#          <conflicting-package> <version>
14# for details, see http://www.debian.org/doc/debian-policy/ or
15# the debian-policy package
16
17# $1 = version of the package being upgraded.
18install() {
19    if [ -f /etc/default/epoptes ]; then
20        . /etc/default/epoptes || true
21    fi
22    SOCKET_GROUP=${SOCKET_GROUP:-epoptes}
23    if ! getent group "$SOCKET_GROUP" >/dev/null; then
24        addgroup --system "$SOCKET_GROUP"
25    fi
26
27    if ! [ -f /etc/epoptes/server.key ] || ! [ -f /etc/epoptes/server.crt ]
28    then
29        openssl req -batch -x509 -nodes -newkey rsa:1024 -days 3652 \
30            -keyout /etc/epoptes/server.key -out /etc/epoptes/server.crt
31        chmod 600 /etc/epoptes/server.key
32        echo '
33A new OpenSSL certificate has been generated for epoptes.
34Please ensure that you transfer /etc/epoptes/server.crt
35to your clients by issuing `epoptes-client -c` from your
36regular workstations or from your LTSP chroots.' >&2
37    fi
38}
39
40case "$1" in
41    configure)
42        install "$2"
43        ;;
44
45    abort-upgrade|abort-remove|abort-deconfigure)
46        ;;
47
48    *)
49        echo "postinst called with unknown argument \`$1'" >&2
50        exit 1
51        ;;
52esac
53
54# dh_installdeb will replace this with shell code automatically
55# generated by other debhelper scripts.
56
57#DEBHELPER#
58
59exit 0
Note: See TracBrowser for help on using the repository browser.