packages/net/ddns-scripts/files/usr/lib/ddns/create_cert_hashes.sh
Steven Barth 07d3672d46 ddns-scripts: Update to Version 2.0.1-1
Squashed commit of the following:

commit fc1d42f069ff930180c5f067c2eb88c9e9df7003
Author: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Date:   Sun Sep 21 18:01:43 2014 +0200

    [ddns-scripts] Update to Version 2.0.1-1

commit 731f9b4df00a8f29df2c17f102356c4d6980918a
Author: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Date:   Sun Sep 21 17:59:25 2014 +0200

    [ddns-scripts] Update to Version 2.0.1-1

    personal helper script to create hashes for CA-Certificates for Wget and cURL using https protocol without errors.

    Sorry GitHub web interface only supports single commits that will be summarized into one pull request.
    Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>

commit df8f6c9d5d31fde24fe1d673949d272d887505e1
Author: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Date:   Sun Sep 21 17:56:05 2014 +0200

    [ddns-scripts] Update to Version 2.0.1-1

    rewritten

    Sorry GitHub web interface only supports single commits that will be summarized into one pull request.
    Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>

commit 50cdf5acb9caecfd9b65ab79696c40fb2bc7037b
Author: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Date:   Sun Sep 21 17:54:40 2014 +0200

    [ddns-scripts] Update to Version 2.0.1-1

    rewritten

    Sorry GitHub web interface only supports single commits that will be summarized into one pull request.
    Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>

commit b1d650a345fb06402c1eac01138cbafcca123a8c
Author: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Date:   Sun Sep 21 17:52:52 2014 +0200

    [ddns-scripts] Update to Version 2.0.1-1

    not needed in this version

    Sorry GitHub web interface only supports single commits that will be summarized into one pull request.
    Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>

commit 9532114b03d428a3162b16e06706d3aa50e601bb
Author: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Date:   Sun Sep 21 17:51:39 2014 +0200

    [ddns-scripts] Update to Version 2.0.1-1

    same function as existing services file but used for IPv6

    Sorry GitHub web interface only supports single commits that will be summarized into one pull request.
    Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>

commit a636bc25c62e23694c009886c13253c9cecc548c
Author: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Date:   Sun Sep 21 17:46:56 2014 +0200

    [ddns-scripts] Update to Version 2.0.1-1

    New file explaining availible parameters.

    Sorry GitHub web interface only supports single commits that will be summarized into one pull request.
    Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>

commit 52332354fc245861e17c898aa6b806f6c174e9a5
Author: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Date:   Sun Sep 21 17:44:45 2014 +0200

    [ddns-scripts] Update to Version 2.0.1-1

    Sorry GitHub web interface only supports single commits that will be summarized into one pull request.

    Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
2014-09-22 08:00:53 +02:00

34 lines
853 B
Bash

#!/bin/sh
#
#set -vx
[ -d /etc/ssl/certs ] || {
echo "CA-Certificates not istalled - please install first"
exit 1
}
NUMCERT=$(find /etc/ssl/certs -name *.crt 2>/dev/null | wc -l)
NUMLINK=$(find /etc/ssl/certs -type l 2>/dev/null | wc -l)
[ $NUMLINK -gt 0 ] && {
echo "File-Links already exist. Exiting"
exit 0
}
[ -f /usr/bin/openssl ] && OPENSSL="EXIST"
[ -z "$OPENSSL" ] && {
opkg update || exit 1
opkg install openssl-util 2>/dev/null
}
for CERTFILE in `ls -1 $(1)/etc/ssl/certs`; do \
HASH=`openssl x509 -hash -noout -in /etc/ssl/certs/$CERTFILE`
SUFFIX=0
while [ -h "/etc/ssl/certs/$HASH.$SUFFIX" ]; do
let "SUFFIX += 1"
done
ln -s "$CERTFILE" "/etc/ssl/certs/$HASH.$SUFFIX"
echo "link $HASH.$SUFFIX created for $CERTFILE"
done
[ -z "$OPENSSL" ] && opkg remove --force-remove --autoremove openssl-util 2>/dev/null