Allow customisation of the paths used by update-ca-certificates

This commit is contained in:
Paul Wise 2014-12-28 14:41:57 +08:00 committed by Michael Shuler
parent 171cf7716b
commit fd660d3b75

View file

@ -23,6 +23,13 @@
verbose=0
fresh=0
CERTSCONF=/etc/ca-certificates.conf
CERTSDIR=/usr/share/ca-certificates
LOCALCERTSDIR=/usr/local/share/ca-certificates
CERTBUNDLE=ca-certificates.crt
ETCCERTSDIR=/etc/ssl/certs
HOOKSDIR=/etc/ca-certificates/update.d
while [ $# -gt 0 ];
do
case $1 in
@ -30,6 +37,24 @@ do
verbose=1;;
--fresh|-f)
fresh=1;;
--certsconf)
shift
CERTSCONF="$1";;
--certsdir)
shift
CERTSDIR="$1";;
--localcertsdir)
shift
LOCALCERTSDIR="$1";;
--certbundle)
shift
CERTBUNDLE="$1";;
--etccertsdir)
shift
ETCCERTSDIR="$1";;
--hooksdir)
shift
HOOKSDIR="$1";;
--help|-h|*)
echo "$0: [--verbose] [--fresh]"
exit;;
@ -37,11 +62,10 @@ do
shift
done
CERTSCONF=/etc/ca-certificates.conf
CERTSDIR=/usr/share/ca-certificates
LOCALCERTSDIR=/usr/local/share/ca-certificates
CERTBUNDLE=ca-certificates.crt
ETCCERTSDIR=/etc/ssl/certs
if [ ! -s "$CERTSCONF" ]
then
fresh=1
fi
cleanup() {
rm -f "$TEMPBUNDLE"
@ -151,7 +175,9 @@ mv -f "$TEMPBUNDLE" "$CERTBUNDLE"
echo "$ADDED_CNT added, $REMOVED_CNT removed; done."
HOOKSDIR=/etc/ca-certificates/update.d
if [ -d "$HOOKSDIR" ]
then
echo -n "Running hooks in $HOOKSDIR...."
VERBOSE_ARG=
[ "$verbose" = 0 ] || VERBOSE_ARG=--verbose
@ -162,5 +188,7 @@ do
done
echo "done."
fi
# vim:set et sw=2: