Added check if we need to sed or echo add it

This commit is contained in:
Alexander Trost
2015-10-09 16:28:42 +02:00
parent 8c73c5c4cb
commit 917e5a811a

View File

@@ -142,7 +142,7 @@ EOF
continue
fi
echo "Setting secret \"$SECRET_KEY\"."
if $(grep "$SECRET_KEY" "$ZULIP_SECRETS"); then
if [ -z "$(grep "$SECRET_KEY" "$ZULIP_SECRETS")" ]; then
sed -i "s~#?${SECRET_KEY}[ ]*=[ ]*['\"]+.*['\"]+$~${SECRET_KEY} = '${SECRET_VAR}'~g" "$ZULIP_SECRETS"
continue
fi