]> WPIA git - nre.git/commitdiff
Rename shell scripts
authorLucas Werkmeister <mail@lucaswerkmeister.de>
Mon, 11 Apr 2016 18:31:43 +0000 (20:31 +0200)
committerLucas Werkmeister <mail@lucaswerkmeister.de>
Mon, 11 Apr 2016 18:31:43 +0000 (20:31 +0200)
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:
README.md
all [moved from all.sh with 60% similarity]
clear [moved from clear.sh with 100% similarity]
collectCRLs [moved from collectCRLs.sh with 97% similarity]
collectGigiConfig [moved from collectGigiConfig.sh with 97% similarity]
collectOffline [moved from collectOffline.sh with 100% similarity]
collectSignerConfig [moved from collectSignerConfig.sh with 98% similarity]
commonFunctions.bash [moved from commonFunctions with 98% similarity]
generateCRLs [moved from generateCRLs.sh with 97% similarity]
generateHtdocs [moved from generateHtdocs.sh with 96% similarity]
generateInfra [moved from generateInfra.sh with 98% similarity]
generateKeys [moved from generateKeys.sh with 97% similarity]
generateTime [moved from generateTime.sh with 97% similarity]
structure.bash [moved from structure with 100% similarity]
summary [moved from summary.sh with 93% similarity]
unpackOffline [moved from unpackOffline.sh with 100% similarity]
verify [moved from verify.sh with 99% similarity]

index 75a13ebfe2f8cde69f660201e258255b51923c18..fdbfc2bba2547be027249a5a2251edfc3e5cb812 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,23 +2,23 @@
 
 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
 
-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':
 
-* `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
 
diff --git a/all.sh b/all
similarity index 60%
rename from all.sh
rename to all
index d8798291507c716c6fc068832d826e61e7f04511..df13337fd37eb6155b2b76e3e75507454d76dfea 100755 (executable)
--- a/all.sh
+++ b/all
@@ -6,28 +6,28 @@ date
 for arg in "$@"; do
     if [[ "$arg" == "root" ]]; then
        echo "========== Generating Root ======="
-       ./clear.sh
-       ./generateKeys.sh
+       ./clear
+       ./generateKeys
     else
        echo "========== Generating Year $arg ======="
-       ./generateTime.sh "$arg"
+       ./generateTime "$arg"
        echo "========== Generating Infra for Year $arg ======="
-       ./generateInfra.sh "$arg"
+       ./generateInfra "$arg"
        echo "========== Generating CRLs for Year $arg ======="
-       ./generateCRLs.sh "$arg"
+       ./generateCRLs "$arg"
        
        
        echo "========== Verifying Year $arg ======="
-       ./verify.sh "$arg"
+       ./verify "$arg"
        
        
        echo "========== Collection things ======="
-       ./collectCRLs.sh "$arg"
-       ./collectGigiConfig.sh "$arg"
-       ./collectOffline.sh "$arg"
-       ./collectSignerConfig.sh "$arg"
+       ./collectCRLs "$arg"
+       ./collectGigiConfig "$arg"
+       ./collectOffline "$arg"
+       ./collectSignerConfig "$arg"
        
-       ./summary.sh "$arg"
+       ./summary "$arg"
     fi
 done
 
diff --git a/clear.sh b/clear
similarity index 100%
rename from clear.sh
rename to clear
similarity index 97%
rename from collectCRLs.sh
rename to collectCRLs
index b123ca35ab2101f5bf1694f8959c0a1d7c57ce9b..d5c1d49ce554a2d7c0ac7e4609e5ca21d529d8e9 100755 (executable)
@@ -5,8 +5,8 @@ set -e
 [ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
 year=$1
 
-. structure
-. commonFunctions
+. structure.bash
+. commonFunctions.bash
 cd generated
 
 fetchCRLS(){ #year, cyear month timeIdx
similarity index 97%
rename from collectGigiConfig.sh
rename to collectGigiConfig
index ee8b4f38108cbcfd651d2a32c21773bf042c33b8..2e4092eff783ddd4848b0ade4a7698310264b865 100755 (executable)
@@ -4,7 +4,7 @@ set -e
 [ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
 year=$1
 
-. structure
+. structure.bash
 cd generated
 
 mkdir -p gigi-config/config/ca
similarity index 100%
rename from collectOffline.sh
rename to collectOffline
similarity index 98%
rename from collectSignerConfig.sh
rename to collectSignerConfig
index d7c3aa64b70b186f4fd6831ab5d3a35ad00db279..84ddfd9ba870d3213586442cd740db902290cded 100755 (executable)
@@ -4,7 +4,7 @@ set -e
 [ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
 year=$1
 
-. structure
+. structure.bash
 cd generated
 
 installCommKeys() { # peer (server,client)
similarity index 98%
rename from commonFunctions
rename to commonFunctions.bash
index f46505b445d912f2d311f7f03bc6474003c616df..1c1ffb18e7d0a02dd23a77c8e7158b7703e59d95 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/bash
-. structure
+. structure.bash
 
 genKey(){ #subj, internalName
     openssl genrsa -out $2.key ${KEYSIZE}
similarity index 97%
rename from generateCRLs.sh
rename to generateCRLs
index 9e4208154c9caefd4dc69805c1f03041e36555ed..0b2c14a79f9b425bd4652c024b3de08203961ac6 100755 (executable)
@@ -5,8 +5,8 @@ set -e
 [ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
 year=$1
 
-. structure
-. commonFunctions
+. structure.bash
+. commonFunctions.bash
 cd generated
 
 generateCRL() { # name, year, month
similarity index 96%
rename from generateHtdocs.sh
rename to generateHtdocs
index 386a3084e7a1d1fcb6252bfc80174bc2d1d1a06e..66d1a0a9ec859099e4a5dc2877fac69a8b3c7a76 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-. structure
+. structure.bash
 [[ "$1" == "" ]] && echo "Usage: $0 <year>" && exit 1
 year=$1
 
similarity index 98%
rename from generateInfra.sh
rename to generateInfra
index 6da93445678c8e858290068e91fed3de4daf7309..4bee84ad8d776ece281734769c6663475b597236 100755 (executable)
@@ -5,8 +5,8 @@ set -e
 [ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
 year=$1
 
-. structure
-. commonFunctions
+. structure.bash
+. commonFunctions.bash
 
 cd generated
 
similarity index 97%
rename from generateKeys.sh
rename to generateKeys
index 698542f0cc09882af77408fbf093b7387e94d9e1..23429cb845f53d8bdbdbd731ad9dfada0b6f0e2b 100755 (executable)
@@ -2,8 +2,8 @@
 # this script generates a set of sample keys
 set -e
 
-. structure
-. commonFunctions
+. structure.bash
+. commonFunctions.bash
 
 mkdir -p generated
 cd generated
similarity index 97%
rename from generateTime.sh
rename to generateTime
index 9e1dec57ff87122fb242d8d7892c3ff9e3fc3179..5cabcbc425abe688bac4a0600ed287da710bd689 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
-. structure
-. commonFunctions
+. structure.bash
+. commonFunctions.bash
 
 [ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
 year=$1
similarity index 100%
rename from structure
rename to structure.bash
similarity index 93%
rename from summary.sh
rename to summary
index 46ce2fb7d961b0dea203db46eb4eb5ae5ab63c25..0b4498a31e8f96889b7bbe414a3fea5bc7cef67e 100755 (executable)
+++ b/summary
@@ -5,8 +5,8 @@ set -e
 [ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1 
 year=$1
 
-. structure
-. commonFunctions
+. structure.bash
+. commonFunctions.bash
 cd generated
 
 
similarity index 100%
rename from unpackOffline.sh
rename to unpackOffline
similarity index 99%
rename from verify.sh
rename to verify
index 25efbddeda7dfc5ff4b0314ab15631155dabc248..4239718e137513b15fb03367ac087bb0ad2f2bcc 100755 (executable)
--- a/verify.sh
+++ b/verify
@@ -3,7 +3,7 @@ set -e
 [ "$1" == "" ] && echo "Usage: $0 <year>" && exit 1
 year=$1
 
-. structure
+. structure.bash
 cd generated
 
 verify(){ # crt, [untrusted], additional