1

My usecase for script is that from my local system I want to check wether a remote port is listening or not.

Expected behavior:

  1. If port is listening, return 'listening'

  2. If no process is running on the port, return 'open'

  3. If port is blocked by firewalld, return 'blocked'.

I tried checking for returncode in socket, but the codes are not consistent. I am getting a combination of 103, 103, 113 etc.

0 Answers0