prevent broken call of delete on bad syntax

This commit is contained in:
finn committed 2026-09-22 19:33:22 -07:00
1 parent f477ea7d6b
commit efa9fee992
1 file changed
+1 -1
+1 -1
View File
@@ -151,7 +151,7 @@ if [[ "$SCRIPT_ACTION" == "l" ]]; then
fi fi
# Destroy # 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_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") 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." echo "Destroying ID:$INSTANCE_ID Hit Ctrl-C in the next 10 seconds to cancel."