commit | author | age
|
8bd4d9
|
1 |
#!/bin/sh |
JK |
2 |
|
|
3 |
for CERTFILE in *.crt |
|
4 |
do |
|
5 |
# make sure file exists and is a valid cert |
|
6 |
test -f "$CERTFILE" || continue |
|
7 |
HASH=$(openssl x509 -noout -hash -in "$CERTFILE") |
|
8 |
test -n "$HASH" || continue |
|
9 |
|
|
10 |
# use lowest available iterator for symlink |
|
11 |
for ITER in 0 1 2 3 4 5 6 7 8 9; do |
|
12 |
test -f "${HASH}.${ITER}" && continue |
|
13 |
cp "$CERTFILE" "${HASH}.${ITER}" |
|
14 |
break |
|
15 |
# ln -s "$CERTFILE" "${HASH}.${ITER}" |
|
16 |
# test -L "${HASH}.${ITER}" && break |
|
17 |
done |
|
18 |
done |