#!/bin/bash # vim: syntax=sh shopt -s nullglob cafile=${1:-/etc/ssl/ca-bundle.pem} cadir="/etc/ssl/certs" for i in "$@"; do if [ "$i" = "-f" ]; then fresh=1 elif [ "$i" = "-v" ]; then verbose=1 fi done if [ -z "$fresh" -a "$cafile" -nt "$cadir" ]; then exit 0 fi echo "creating $cafile ..." cat > "$cafile.new" <&2; continue ;; esac fi openssl x509 -in "$i" done >> "$cafile.new" mv "$cafile.new" "$cafile"