|
179 | 179 | # 2017-01-12 added drill, dig or host as alternatives to nslookup (2.04)
|
180 | 180 | # 2017-01-18 bugfix issue #227 - error deleting csr if doesn't exist
|
181 | 181 | # 2017-01-18 issue #228 check private key and account key are different (2.05)
|
| 182 | +# 2017-01-21 issue #231 mingw bugfix and typos in debug messages (2.06) |
182 | 183 | # ----------------------------------------------------------------------------------------
|
183 | 184 |
|
184 | 185 | PROGNAME=${0##*/}
|
185 |
| -VERSION="2.05" |
| 186 | +VERSION="2.06" |
186 | 187 |
|
187 | 188 | # defaults
|
188 | 189 | ACCOUNT_KEY_LENGTH=4096
|
@@ -618,13 +619,13 @@ create_key() { # create a domain key (if it doesn't already exist)
|
618 | 619 | key_type=$1 # domain key type
|
619 | 620 | key_loc=$2 # domain key location
|
620 | 621 | key_len=$3 # domain key length - for rsa keys.
|
621 |
| - # check if domain key exists, if not then create it. |
| 622 | + # check if key exists, if not then create it. |
622 | 623 | if [[ -s "$key_loc" ]]; then
|
623 | 624 | debug "domain key exists at $key_loc - skipping generation"
|
624 | 625 | # ideally need to check validity of domain key
|
625 | 626 | else
|
626 | 627 | umask 077
|
627 |
| - info "creating domain key - $key_loc" |
| 628 | + info "creating key - $key_loc" |
628 | 629 | case "$key_type" in
|
629 | 630 | rsa)
|
630 | 631 | openssl genrsa "$key_len" > "$key_loc";;
|
@@ -843,7 +844,7 @@ get_os() { # function to get the current Operating System
|
843 | 844 | os="mac"
|
844 | 845 | elif [[ ${uname_res:0:6} == "CYGWIN" ]]; then
|
845 | 846 | os="cygwin"
|
846 |
| - elif [[ ${uname_res:0:6} == "MINGW" ]]; then |
| 847 | + elif [[ ${uname_res:0:5} == "MINGW" ]]; then |
847 | 848 | os="mingw"
|
848 | 849 | else
|
849 | 850 | os="unknown"
|
@@ -1417,6 +1418,11 @@ done
|
1417 | 1418 | # Get the current OS, so the correct functions can be used for that OS. (sets the variable os)
|
1418 | 1419 | get_os
|
1419 | 1420 |
|
| 1421 | +# check if "recent" version of bash. |
| 1422 | +#if [[ "${BASH_VERSINFO[0]}${BASH_VERSINFO[1]}" -lt 42 ]]; then |
| 1423 | +# info "this script is designed for bash v4.2 or later - earlier version may give errors" |
| 1424 | +#fi |
| 1425 | + |
1420 | 1426 | #check if required applications are included
|
1421 | 1427 |
|
1422 | 1428 | requires which
|
@@ -1480,6 +1486,9 @@ DOMAIN_DIR="$DOMAIN_STORAGE/$DOMAIN"
|
1480 | 1486 | CERT_FILE="$DOMAIN_DIR/${DOMAIN}.crt"
|
1481 | 1487 | CA_CERT="$DOMAIN_DIR/chain.crt"
|
1482 | 1488 | TEMP_DIR="$DOMAIN_DIR/tmp"
|
| 1489 | +if [[ "$os" == "mingw" ]]; then |
| 1490 | + CSR_SUBJECT="//" |
| 1491 | +fi |
1483 | 1492 |
|
1484 | 1493 | # Set the OPENSSL_CONF environment variable so openssl knows which config to use
|
1485 | 1494 | export OPENSSL_CONF=$SSLCONF
|
|
0 commit comments