Distance-dependent danger responses in bacteria