Explorar el Código

Merge pull request #7874 from gyuho/scripts

integration/fixtures-expired: do not force 'rm'
Gyu-Ho Lee hace 8 años
padre
commit
7f05e220a4
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  1. 7 2
      integration/fixtures-expired/gencerts.sh

+ 7 - 2
integration/fixtures-expired/gencerts.sh

@@ -1,6 +1,11 @@
 #!/usr/bin/env bash
 #!/usr/bin/env bash
 set -e
 set -e
 
 
+if ! [[ "$0" =~ "./gencerts.sh" ]]; then
+	echo "must be run from 'fixtures-expired'"
+	exit 255
+fi
+
 if which cfssl >/dev/null; then
 if which cfssl >/dev/null; then
     echo "cfssl is installed; generating certs"
     echo "cfssl is installed; generating certs"
 else
 else
@@ -77,8 +82,8 @@ cfssl gencert \
     --config ./etcd-gencert.json \
     --config ./etcd-gencert.json \
     ./server-ca-csr.json | cfssljson --bare ./server
     ./server-ca-csr.json | cfssljson --bare ./server
 
 
-rm -f ./*.json
-rm -f ./*.csr
+rm ./*.json
+rm ./*.csr
 
 
 if which openssl >/dev/null; then
 if which openssl >/dev/null; then
     openssl x509 -in ./etcd-root-ca.pem -text -noout
     openssl x509 -in ./etcd-root-ca.pem -text -noout