`[ -n "$ext" ]` is more idiomatic ("is $ext set", instead of "is not $ext not set").

If you fix that, I'd be happy to merge.