From 4edbae4a914d169374a24d6d9e23080213ff8d93 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Wed, 3 May 2017 18:45:44 -0700 Subject: [PATCH] integration/fixtures-expired: do not force 'rm' To make gencerts.sh script safer. Signed-off-by: Gyu-Ho Lee --- integration/fixtures-expired/gencerts.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/integration/fixtures-expired/gencerts.sh b/integration/fixtures-expired/gencerts.sh index 36ecf839c..3722b75ce 100755 --- a/integration/fixtures-expired/gencerts.sh +++ b/integration/fixtures-expired/gencerts.sh @@ -1,6 +1,11 @@ #!/usr/bin/env bash set -e +if ! [[ "$0" =~ "./gencerts.sh" ]]; then + echo "must be run from 'fixtures-expired'" + exit 255 +fi + if which cfssl >/dev/null; then echo "cfssl is installed; generating certs" else @@ -77,8 +82,8 @@ cfssl gencert \ --config ./etcd-gencert.json \ ./server-ca-csr.json | cfssljson --bare ./server -rm -f ./*.json -rm -f ./*.csr +rm ./*.json +rm ./*.csr if which openssl >/dev/null; then openssl x509 -in ./etcd-root-ca.pem -text -noout