]>
Commit | Line | Data |
---|---|---|
4968d0f7 WB |
1 | #!/bin/bash |
2 | ||
3 | # Abort if any command returns an error value | |
4 | set -e | |
5 | ||
6 | # This script is called as the last step of the installation of the | |
7 | # package. All the package's files are in place, dpkg has already | |
8 | # done its automatic conffile handling, and all the packages we depend | |
9 | # of are already fully installed and configured. | |
10 | ||
11 | # The following idempotent stuff doesn't generally need protecting | |
12 | # against being run in the abort-* cases. | |
13 | ||
14 | # Use debconf. (installs templates) | |
15 | . /usr/share/debconf/confmodule | |
16 | # all done with debconf here. | |
17 | db_stop | |
18 | ||
19 | case "$1" in | |
20 | triggered) | |
21 | # We don't print a status message here, as dpkg already said | |
22 | # "Processing triggers for ...". | |
23 | exit 0;; | |
24 | ||
25 | configure) | |
26 | # Configure this package. If the package must prompt the user for | |
27 | # information, do it here. | |
28 | ||
29 | # test if /etc/pve is mounted; else simple exit to avoid | |
30 | # error during updates | |
31 | if test -f /etc/pve/local/pve-ssl.pem | |
32 | then | |
4968d0f7 | 33 | /usr/sbin/pve-update-lxc-config |
4968d0f7 WB |
34 | fi |
35 | ||
4968d0f7 WB |
36 | # There are three sub-cases: |
37 | if test "${2+set}" != set; then | |
38 | # We're being installed by an ancient dpkg which doesn't remember | |
39 | # which version was most recently configured, or even whether | |
40 | # there is a most recently configured version. | |
41 | : | |
42 | ||
43 | elif test -z "$2" -o "$2" = "<unknown>"; then | |
44 | # The package has not ever been configured on this system, or was | |
45 | # purged since it was last configured. | |
46 | : | |
47 | ||
48 | else | |
49 | # Version $2 is the most recently configured version of this | |
50 | # package. | |
51 | : | |
52 | ||
53 | fi ;; | |
54 | abort-upgrade) | |
55 | # Back out of an attempt to upgrade this package FROM THIS VERSION | |
56 | # to version $2. Undo the effects of "prerm upgrade $2". | |
57 | : | |
58 | ||
59 | ;; | |
60 | abort-remove) | |
61 | if test "$2" != in-favour; then | |
62 | echo "$0: undocumented call to \`postinst $*'" 1>&2 | |
63 | exit 0 | |
64 | fi | |
65 | # Back out of an attempt to remove this package, which was due to | |
66 | # a conflict with package $3 (version $4). Undo the effects of | |
67 | # "prerm remove in-favour $3 $4". | |
68 | : | |
69 | ||
70 | ;; | |
71 | abort-deconfigure) | |
72 | if test "$2" != in-favour -o "$5" != removing; then | |
73 | echo "$0: undocumented call to \`postinst $*'" 1>&2 | |
74 | exit 0 | |
75 | fi | |
76 | # Back out of an attempt to deconfigure this package, which was | |
77 | # due to package $6 (version $7) which we depend on being removed | |
78 | # to make way for package $3 (version $4). Undo the effects of | |
79 | # "prerm deconfigure in-favour $3 $4 removing $6 $7". | |
80 | : | |
81 | ||
82 | ;; | |
83 | *) echo "$0: didn't understand being called with \`$1'" 1>&2 | |
84 | exit 0;; | |
85 | esac | |
86 | ||
87 | exit 0 |