43 lines
1.2 KiB
Bash
Executable file
43 lines
1.2 KiB
Bash
Executable file
#!/bin/bash
|
|
################################################################################
|
|
# Intended use: Simple shell script to create certs (RSA or EC)
|
|
#
|
|
# Notes: This script support Linux Bash shell script only
|
|
# Install Bash from https://www.gnu.org/software/bash/
|
|
#
|
|
# Copyright (C) 2015 - 2025, VGISC Dev Team <dev@vgisc.com>
|
|
################################################################################
|
|
|
|
filepath=`readlink -f $0`
|
|
basedir=`dirname $filepath`
|
|
SERVER_DIR="$basedir/server"
|
|
DOMAIN="vgisc.com"
|
|
|
|
OPENSSL_BIN="$basedir/bin/openssl"
|
|
MKC4B_B64_BIN="$basedir/bin/util_mkc4b_encrypt_encode_file"
|
|
|
|
i=1
|
|
NUM=10
|
|
|
|
echo "==========================================================="
|
|
echo "Generating cert/key for server in $SERVER_DIR/..."
|
|
echo "==========================================================="
|
|
echo ""
|
|
|
|
while [ $i -le $NUM ]
|
|
do
|
|
echo "Generating cert/key for server \"server$i.vgisc.com\"..."
|
|
echo ""
|
|
|
|
./build.sh rsa server server$i.vgisc.com
|
|
${MKC4B_B64_BIN} -e $SERVER_DIR/server$i.vgisc.com.key $SERVER_DIR/server$i.vgisc.com.b64
|
|
|
|
i=`expr $i + 1`
|
|
done
|
|
|
|
cp -rf $SERVER_DIR/* $basedir/$DOMAIN/
|
|
|
|
echo "All plain text encrypted and server key/cert files have saved to ./$DOMAIN/"
|
|
echo ""
|
|
|
|
echo "All Done"
|