Fix bash loop for service inspection