| 1 |
#!/bin/sh |
| 2 |
set -e |
| 3 |
|
| 4 |
if [ -t 0 ]; then |
| 5 |
echo "This hook script expects the list of PEM files to be added/removed" >&2 |
| 6 |
echo "prefixed with '+'/'-' to be piped into stdin." >&2 |
| 7 |
exit 1 |
| 8 |
fi |
| 9 |
|
| 10 |
# record the pending certificate updates for later execution by the |
| 11 |
# triggers in ca-certificates-java |
| 12 |
|
| 13 |
mkdir -p /var/lib/ca-certificates-java |
| 14 |
cat - >> /var/lib/ca-certificates-java/pending |
| 15 |
|
| 16 |
case "$1" in |
| 17 |
-f|--fresh) |
| 18 |
dpkg-trigger --no-await update-ca-certificates-java-fresh |
| 19 |
;; |
| 20 |
*) |
| 21 |
dpkg-trigger --no-await update-ca-certificates-java |
| 22 |
;; |
| 23 |
esac |
| 24 |
|
| 25 |
# if the hook was activated by a manual run of update-ca-certificates |
| 26 |
# (and not from a maintainer script), ensure the triggers get processed |
| 27 |
|
| 28 |
if [ -z "$DPKG_MAINTSCRIPT_PACKAGE" ]; then |
| 29 |
dpkg --triggers-only --pending |
| 30 |
fi |