From efa9fee992da156c85e007f701d4028660632f7e Mon Sep 17 00:00:00 2001 From: finn Date: Tue, 22 Sep 2026 19:33:22 -0700 Subject: [PATCH] prevent broken call of delete on bad syntax --- create-linode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create-linode.sh b/create-linode.sh index 9dafcbd..9b88bad 100755 --- a/create-linode.sh +++ b/create-linode.sh @@ -151,7 +151,7 @@ if [[ "$SCRIPT_ACTION" == "l" ]]; then fi # Destroy -if [[ "$SCRIPT_ACTION" == "d" ]]; then +if [[ "$SCRIPT_ACTION" == "d" && -n "$LINODE_LABEL" ]]; then INSTANCE_IP=$(curl -s -H "Authorization: Bearer $LINODE_API_KEY" https://api.linode.com/v4/linode/instances | jq '.data[] | select(.label == "'$LINODE_LABEL'") | .ipv4[]' | sed -e "s/\"//g") INSTANCE_ID=$(curl -s -H "Authorization: Bearer $LINODE_API_KEY" https://api.linode.com/v4/linode/instances | jq '.data[] | select(.label == "'$LINODE_LABEL'") | .id' | sed -e "s/\"//g") echo "Destroying ID:$INSTANCE_ID Hit Ctrl-C in the next 10 seconds to cancel."