| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
if [ -f /usr/share/debconf/confmodule ] && \ |
| 6 |
( [ "$DEBCONF_USE_CDEBCONF" ] || perl -e "" 2>/dev/null ) |
| 7 |
then |
| 8 |
. /usr/share/debconf/confmodule |
| 9 |
else |
| 10 |
exit 0 |
| 11 |
fi |
| 12 |
|
| 13 |
#DEBHELPER# |
| 14 |
|
| 15 |
USERNAME=debian-security-support |
| 16 |
LIB_DIR="/var/lib/$USERNAME" |
| 17 |
|
| 18 |
###################################################################### |
| 19 |
# # |
| 20 |
# WARNING: if you modify code here, you probably also need to modify # |
| 21 |
# ../check-support-status.hook # |
| 22 |
# # |
| 23 |
###################################################################### |
| 24 |
|
| 25 |
case "$1" in |
| 26 |
configure) |
| 27 |
if [ "$TMPDIR" ] && [ "$(stat --format=%a "$TMPDIR")" != '1777' ] ; then |
| 28 |
export TMPDIR='/tmp' |
| 29 |
fi |
| 30 |
|
| 31 |
TEMPDIR="$(mktemp --tmpdir --directory debian-security-support.postinst.XXXXX)" |
| 32 |
trap "rm -rf '$TEMPDIR'" EXIT |
| 33 |
|
| 34 |
MODES="ended limited earlyend" |
| 35 |
|
| 36 |
for MODE in $MODES ; do |
| 37 |
OUTPUT="$TEMPDIR/output" |
| 38 |
runuser --user="$USERNAME" -- \ |
| 39 |
check-support-status \ |
| 40 |
--type "$MODE" \ |
| 41 |
--no-heading \ |
| 42 |
--status-db "$LIB_DIR/security-support.semaphore" \ |
| 43 |
>"$OUTPUT" |
| 44 |
|
| 45 |
if [ -s "$OUTPUT" ] ; then |
| 46 |
db_capb escape |
| 47 |
db_subst debian-security-support/$MODE MESSAGE "$(debconf-escape -e <"$OUTPUT")" |
| 48 |
db_input critical debian-security-support/$MODE || true |
| 49 |
db_go |
| 50 |
db_reset debian-security-support/$MODE |
| 51 |
fi |
| 52 |
done |
| 53 |
;; |
| 54 |
abort-upgrade|abort-remove|abort-deconfigure) |
| 55 |
;; |
| 56 |
triggered) |
| 57 |
;; |
| 58 |
*) |
| 59 |
echo "postinst called with unknown argument '$1'" |
| 60 |
exit 1 |
| 61 |
;; |
| 62 |
esac |
| 63 |
|
| 64 |
db_stop |
| 65 |
|
| 66 |
exit 0 |