My usecase for script is that from my local system I want to check wether a remote port is listening or not.
Expected behavior:
If port is listening, return 'listening'
If no process is running on the port, return 'open'
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.