From b2afbfd4fb81ed035ffc9275de87fa6577b56d5a Mon Sep 17 00:00:00 2001 From: Smaine Kahlouch Date: Mon, 21 Dec 2015 14:23:33 +0100 Subject: [PATCH] don't touch if the file exists --- roles/kubernetes/node/files/kube-gen-token.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/kubernetes/node/files/kube-gen-token.sh b/roles/kubernetes/node/files/kube-gen-token.sh index fa6a5ddc7..121b52263 100644 --- a/roles/kubernetes/node/files/kube-gen-token.sh +++ b/roles/kubernetes/node/files/kube-gen-token.sh @@ -19,7 +19,10 @@ token_file="${token_dir}/known_tokens.csv" create_accounts=($@) -touch "${token_file}" +if [ ! -e "${token_file}" ]; then + touch "${token_file}" +fi + for account in "${create_accounts[@]}"; do if grep ",${account}," "${token_file}" ; then continue