From d3f2401cb295a42fd0091e9fe83c7b63dd0fa7c9 Mon Sep 17 00:00:00 2001 From: pvincent Date: Thu, 1 Oct 2020 16:39:08 +0400 Subject: [PATCH] genpasswd + ssl_check_domain --- tools/genpasswd | 12 ++++++++++++ tools/ssl_check_domain | 5 +++++ 2 files changed, 17 insertions(+) create mode 100755 tools/genpasswd create mode 100755 tools/ssl_check_domain diff --git a/tools/genpasswd b/tools/genpasswd new file mode 100755 index 0000000..51d0300 --- /dev/null +++ b/tools/genpasswd @@ -0,0 +1,12 @@ +#!/bin/bash + +SIZE=${1:-12} +re='^[0-9]+$' +if ! [[ $SIZE =~ $re ]] ;then + echo "error: SIZE=$SIZE Not a number" >&2; exit 1 +fi +if [[ $SIZE -lt 4 || $SIZE -gt 20 ]]; then + echo "expected SIZE=$SIZE not in range [4..20]" >&2; exit 1 +fi + +tr -cd '[:alnum:]' < /dev/urandom | fold -w $SIZE | head -n1 diff --git a/tools/ssl_check_domain b/tools/ssl_check_domain new file mode 100755 index 0000000..d1214c2 --- /dev/null +++ b/tools/ssl_check_domain @@ -0,0 +1,5 @@ +#!/bin/bash + +DOMAIN_NAME=$1 +curl --insecure -v https://$DOMAIN_NAME 2>&1 | awk 'BEGIN { cert=0 } /^\* Server certificate:/ { cert=1 } /^\*/ { if (cert) print }' +