#!/bin/bash # vim: syntax=sh shopt -s nullglob cafile="/var/lib/ca-certificates/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" chown root:system $cafile chmod 664 $cafile chsmack -a "System::Shared" $cafile