#!/bin/sh -e
-# This is a copy of update-ca-certificates from the ca-certificates package in jessie
-# with patches applied to allow custom paths and to allow setting to default certs:
+# This is a copy of update-ca-certificates from the ca-certificates package in stretch
+# It allows custom paths and setting to default certs:
# https://bugs.debian.org/774059
# https://bugs.debian.org/774201
#
#
# Copyright (c) 2003 Fumitoshi UKAI <ukai@debian.or.jp>
# Copyright (c) 2009 Philipp Kern <pkern@debian.org>
-#
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "$CERT" ]
then
ln -sf "$CERT" "$PEM"
- echo +$PEM >> "$ADDED"
+ echo "+$PEM" >> "$ADDED"
fi
# Add trailing newline to certificate, if it is missing (#635570)
sed -e '$a\' "$CERT" >> "$TEMPBUNDLE"
if test -L "$PEM"
then
rm -f "$PEM"
- echo -$PEM >> "$REMOVED"
+ echo "-$PEM" >> "$REMOVED"
fi
}
-cd $ETCCERTSDIR
+cd "$ETCCERTSDIR"
if [ "$fresh" = 1 ]; then
- echo -n "Clearing symlinks in $ETCCERTSDIR..."
+ echo "Clearing symlinks in $ETCCERTSDIR..."
find . -type l -print | while read symlink
do
- case $(readlink $symlink) in
- $CERTSDIR*) rm -f $symlink;;
+ case $(readlink "$symlink") in
+ $CERTSDIR*) rm -f "$symlink";;
esac
done
find . -type l -print | while read symlink
do
- test -f $symlink || rm -f $symlink
+ test -f "$symlink" || rm -f "$symlink"
done
echo "done."
fi
-echo -n "Updating certificates in $ETCCERTSDIR... "
+echo "Updating certificates in $ETCCERTSDIR..."
# Add default certificate authorities if requested
if [ "$default" = 1 ]; then
# Handle certificates that should be removed. This is an explicit act
# by prefixing lines in the configuration files with exclamation marks (!).
-sed -n -e '/^$/d' -e 's/^!//p' $CERTSCONF | while read crt
+sed -n -e '/^$/d' -e 's/^!//p' "$CERTSCONF" | while read crt
do
remove "$CERTSDIR/$crt"
done
-sed -e '/^$/d' -e '/^#/d' -e '/^!/d' $CERTSCONF | while read crt
+sed -e '/^$/d' -e '/^#/d' -e '/^!/d' "$CERTSCONF" | while read crt
do
if ! test -f "$CERTSDIR/$crt"
then
if [ -d "$HOOKSDIR" ]
then
-echo -n "Running hooks in $HOOKSDIR...."
-VERBOSE_ARG=
-[ "$verbose" = 0 ] || VERBOSE_ARG=--verbose
-eval run-parts $VERBOSE_ARG --test -- $HOOKSDIR | while read hook
-do
- ( cat $ADDED
- cat $REMOVED ) | $hook || echo E: $hook exited with code $?.
-done
-echo "done."
+ echo "Running hooks in $HOOKSDIR..."
+ VERBOSE_ARG=
+ [ "$verbose" = 0 ] || VERBOSE_ARG="--verbose"
+ eval run-parts "$VERBOSE_ARG" --test -- "$HOOKSDIR" | while read hook
+ do
+ ( cat "$ADDED"
+ cat "$REMOVED" ) | "$hook" || echo "E: $hook exited with code $?."
+ done
+ echo "done."
fi
# vim:set et sw=2:
-