summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shuler <michael@pbandjelly.org>2015-01-17 14:33:46 -0600
committerMichael Shuler <michael@pbandjelly.org>2015-01-17 14:33:46 -0600
commita7608d81b237c62ab587f452668aa19bef44d20e (patch)
tree472e7a6d414e95b9c661c4b47df3ab0ae1ffd540
parent4c8d6b1f96e978934063f5f7e9deacbc71afdb02 (diff)
downloadca-certificates-a7608d81b237c62ab587f452668aa19bef44d20e.tar.gz
Fix shellcheck warnings and a little indentation
-rwxr-xr-xsbin/update-ca-certificates41
1 files changed, 20 insertions, 21 deletions
diff --git a/sbin/update-ca-certificates b/sbin/update-ca-certificates
index a0c8f06..d3e8f8b 100755
--- a/sbin/update-ca-certificates
+++ b/sbin/update-ca-certificates
@@ -4,7 +4,7 @@
#
# 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
@@ -95,7 +95,7 @@ add() {
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"
@@ -107,27 +107,27 @@ remove() {
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
@@ -139,12 +139,12 @@ fi
# 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
@@ -190,17 +190,16 @@ echo "$ADDED_CNT added, $REMOVED_CNT removed; done."
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:
-