The usual convention is have no file name extension for executable
scripts, and to name library scripts according to their shell (here:
.bash). The rationale for the first part is that users do not need to
konw whether a program is a shell script or not, and this allows one to
rewrite the program in a different language (interpreted or compiled)
without having to update anything that refers to the program name
(documentation, crontab, etc.).
In this case, the file name extensions were also misleading, since the
scripts have a Bash shebang and use Bash features. If a user, based on
the file name extension, had tried to run a script as `sh all.sh`, it
would not have worked.
Citation: Google Shell Style Guide,
https://google.github.io/styleguide/shell.xml#File_Extensions
17 files changed:
This is the a project that contains scripts to generate CAcerts new ( after 2015 ) root structure.
This is the a project that contains scripts to generate CAcerts new ( after 2015 ) root structure.
-You can run the whole generation process for 2015 by invoking `./all.sh root 2015`.
+You can run the whole generation process for 2015 by invoking `./all root 2015`.
## Overview of Generating Shell Scripts
## Overview of Generating Shell Scripts
-The shellscripts that can be invoked (in order of `all.sh`) are:
+The shellscripts that can be invoked (in order of `all`) are:
-* `clear.sh` remove all previously generated keys
-* `generateKeys.sh` generate the root certificate and structure certificates (levels 0 and 1)
-* `generateTime.sh 2015` generate the sub-cas for the year 2015
-* `generateInfra.sh 2015` generate the CAcert Infrastructure keys (gigi ssl, gigi smime, signer communication, ...)
-* `verify.sh 2015` verify all keys for the year 2015
-* (optional) `generateSignerConfig.sh 2015` generate config to be deployed on cassiopeia
+* `clear` remove all previously generated keys
+* `generateKeys` generate the root certificate and structure certificates (levels 0 and 1)
+* `generateTime 2015` generate the sub-cas for the year 2015
+* `generateInfra 2015` generate the CAcert Infrastructure keys (gigi ssl, gigi smime, signer communication, ...)
+* `verify 2015` verify all keys for the year 2015
+* (optional) `generateSignerConfig 2015` generate config to be deployed on cassiopeia
all these scripts depend on 2 'library-scripts':
all these scripts depend on 2 'library-scripts':
-* `commonFunctions` functions used all over those scripts
-* `structure` definitions of what cas and keys exist
+* `commonFunctions.bash` functions used all over those scripts
+* `structure.bash` definitions of what cas and keys exist
## Other Files and Folders
## Other Files and Folders
for arg in "$@"; do
if [[ "$arg" == "root" ]]; then
echo "========== Generating Root ======="
for arg in "$@"; do
if [[ "$arg" == "root" ]]; then
echo "========== Generating Root ======="
- ./clear.sh
- ./generateKeys.sh
+ ./clear
+ ./generateKeys
else
echo "========== Generating Year $arg ======="
else
echo "========== Generating Year $arg ======="
- ./generateTime.sh "$arg"
echo "========== Generating Infra for Year $arg ======="
echo "========== Generating Infra for Year $arg ======="
- ./generateInfra.sh "$arg"
echo "========== Generating CRLs for Year $arg ======="
echo "========== Generating CRLs for Year $arg ======="
- ./generateCRLs.sh "$arg"
echo "========== Verifying Year $arg ======="
echo "========== Verifying Year $arg ======="
echo "========== Collection things ======="
echo "========== Collection things ======="
- ./collectCRLs.sh "$arg"
- ./collectGigiConfig.sh "$arg"
- ./collectOffline.sh "$arg"
- ./collectSignerConfig.sh "$arg"
+ ./collectCRLs "$arg"
+ ./collectGigiConfig "$arg"
+ ./collectOffline "$arg"
+ ./collectSignerConfig "$arg"
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
-. structure
-. commonFunctions
+. structure.bash
+. commonFunctions.bash
cd generated
fetchCRLS(){ #year, cyear month timeIdx
cd generated
fetchCRLS(){ #year, cyear month timeIdx
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
cd generated
mkdir -p gigi-config/config/ca
cd generated
mkdir -p gigi-config/config/ca
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
cd generated
installCommKeys() { # peer (server,client)
cd generated
installCommKeys() { # peer (server,client)
genKey(){ #subj, internalName
openssl genrsa -out $2.key ${KEYSIZE}
genKey(){ #subj, internalName
openssl genrsa -out $2.key ${KEYSIZE}
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
-. structure
-. commonFunctions
+. structure.bash
+. commonFunctions.bash
cd generated
generateCRL() { # name, year, month
cd generated
generateCRL() { # name, year, month
[[ "$1" == "" ]] && echo "Usage: $0 <year>" && exit 1
year=$1
[[ "$1" == "" ]] && echo "Usage: $0 <year>" && exit 1
year=$1
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
-. structure
-. commonFunctions
+. structure.bash
+. commonFunctions.bash
# this script generates a set of sample keys
set -e
# this script generates a set of sample keys
set -e
-. structure
-. commonFunctions
+. structure.bash
+. commonFunctions.bash
mkdir -p generated
cd generated
mkdir -p generated
cd generated
-. structure
-. commonFunctions
+. structure.bash
+. commonFunctions.bash
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
-. structure
-. commonFunctions
+. structure.bash
+. commonFunctions.bash
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
[ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
year=$1
cd generated
verify(){ # crt, [untrusted], additional
cd generated
verify(){ # crt, [untrusted], additional