summaryrefslogblamecommitdiffstats
path: root/split-ca-bundle.sh
blob: 80217ec39fe30a64cba56a25aef99dff068159b6 (plain) (tree)
1
2

         















                                                                           
#!/bin/sh

prev=
while read line; do
	case "$line" in
	=*=)
		fname="$(printf "%s" "$prev" | tr '/ (),' '__==_').crt"
		while read cline; do
			printf "%s\n" "$cline"
			if [ "$cline" = "-----END CERTIFICATE-----" ]; then
				break;
			fi
		done > "$fname"
		;;
	esac
	prev="$line"
done