Commit 668a2757 authored by Vincent Pelletier's avatar Vincent Pelletier

shell/caucase.sh: Remove unnecessary return statements.

If there is no return statement, shell functions return the status of the
last command they ran. So "return $?" as last function statement is
superfluous.
parent 45385484
...@@ -207,7 +207,6 @@ PUTNoOut () { ...@@ -207,7 +207,6 @@ PUTNoOut () {
_matchCertificateBoundary () { _matchCertificateBoundary () {
test "$1" = '-----END CERTIFICATE-----' test "$1" = '-----END CERTIFICATE-----'
return $?
} }
_matchPrivateKeyBoundary () { _matchPrivateKeyBoundary () {
...@@ -270,7 +269,6 @@ expiresBefore () { ...@@ -270,7 +269,6 @@ expiresBefore () {
enddate="$(openssl x509 -enddate -noout | sed 's/^[^=]*=//')" enddate="$(openssl x509 -enddate -noout | sed 's/^[^=]*=//')"
test $? -ne 0 && return 1 test $? -ne 0 && return 1
test "$(date --date="$enddate" +%s)" -lt "$1" test "$(date --date="$enddate" +%s)" -lt "$1"
return $?
} }
printIfExpiresAfter () { printIfExpiresAfter () {
...@@ -314,7 +312,6 @@ checkCertificateMatchesKey () { ...@@ -314,7 +312,6 @@ checkCertificateMatchesKey () {
)" = "$( )" = "$(
echo "$2" | openssl rsa -modulus -noout | sed 's/^Modulus=//' echo "$2" | openssl rsa -modulus -noout | sed 's/^Modulus=//'
)" )"
return $?
} }
checkDeps () { checkDeps () {
...@@ -412,7 +409,6 @@ revokeCertificate () { ...@@ -412,7 +409,6 @@ revokeCertificate () {
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--insecure \ --insecure \
"$1/crt/revoke/" "$1/crt/revoke/"
return $?
} }
revokeCRTWithoutKey () { revokeCRTWithoutKey () {
...@@ -424,7 +420,6 @@ revokeCRTWithoutKey () { ...@@ -424,7 +420,6 @@ revokeCRTWithoutKey () {
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--cacert "$2" \ --cacert "$2" \
"$1/crt/revoke/" "$1/crt/revoke/"
return $?
} }
revokeSerial () { revokeSerial () {
...@@ -436,7 +431,6 @@ revokeSerial () { ...@@ -436,7 +431,6 @@ revokeSerial () {
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--cacert "$2" \ --cacert "$2" \
"$1/crt/revoke/" "$1/crt/revoke/"
return $?
} }
updateCACertificate () { updateCACertificate () {
...@@ -476,19 +470,16 @@ updateCACertificate () { ...@@ -476,19 +470,16 @@ updateCACertificate () {
getCertificateRevocationList () { getCertificateRevocationList () {
# Usage: <url> <ca> # Usage: <url> <ca>
CURL --insecure "$1/crl" | openssl crl -CAfile "$2" 2> /dev/null CURL --insecure "$1/crl" | openssl crl -CAfile "$2" 2> /dev/null
return $?
} }
getCertificateSigningRequest () { getCertificateSigningRequest () {
# Usage: <url> <csr id> # Usage: <url> <csr id>
CURL --insecure "$1/csr/$2" CURL --insecure "$1/csr/$2"
return $?
} }
getPendingCertificateRequestList () { getPendingCertificateRequestList () {
# Usage: <url> <ca> <user crt> # Usage: <url> <ca> <user crt>
CURL --cert "$3" --cacert "$2" "$1/csr" CURL --cert "$3" --cacert "$2" "$1/csr"
return $?
} }
createCertificateSigningRequest () { createCertificateSigningRequest () {
...@@ -503,13 +494,11 @@ createCertificateSigningRequest () { ...@@ -503,13 +494,11 @@ createCertificateSigningRequest () {
;; ;;
esac esac
done done
return $?
} }
deletePendingCertificateRequest () { deletePendingCertificateRequest () {
# Usage: <url> <ca> <user crt> <csr id> # Usage: <url> <ca> <user crt> <csr id>
CURL --request DELETE --cert "$3" --cacert "$2" "$1/csr/$4" CURL --request DELETE --cert "$3" --cacert "$2" "$1/csr/$4"
return $?
} }
getCertificate () { getCertificate () {
...@@ -540,7 +529,6 @@ createCertificateWith () { ...@@ -540,7 +529,6 @@ createCertificateWith () {
# Usage: <url> <ca> <user crt> <csr id> < csr # Usage: <url> <ca> <user crt> <csr id> < csr
PUTNoOut --cert "$3" --cacert "$2" \ PUTNoOut --cert "$3" --cacert "$2" \
--header 'Content-Type: application/pkcs10' "$1/crt/$4" --header 'Content-Type: application/pkcs10' "$1/crt/$4"
return $?
} }
if [ $# -ne 0 ]; then if [ $# -ne 0 ]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment