Overview
Request 1090230 accepted
- Use the bash intrinsic virtual file /dev/tcp/localhost/
to check for MTA port
- Avoid fuser for detecting if sendmail is listen on MTA port
- Created by WernerFink
- In state accepted
- Supersedes 1090009
you could just evaluate ss -Hlnpt "sport == $port" | grep -q .
to see if it's up
I know ... also nmap/netstat or many more ... this is a bash shell script and it works without having a further requirement
Another option (since you are already exercising bash-only features) (echo >/dev/tcp/localhost/25) 2>/dev/zero
and evaluating $?
I do not have a /dev/tcp/
here ... seems to require an other udev rule ... or bash had not shown this here
Request History
WernerFink created request
- Use the bash intrinsic virtual file /dev/tcp/localhost/
to check for MTA port
- Avoid fuser for detecting if sendmail is listen on MTA port
staging-bot set openSUSE:Factory:Staging:D as a staging project
Being evaluated by staging project "openSUSE:Factory:Staging:D"
staging-bot accepted review
Picked "openSUSE:Factory:Staging:D"
factory-auto added opensuse-review-team as a reviewer
Please review sources
factory-auto accepted review
Check script succeeded
licensedigger accepted review
ok
dimstar accepted review
dimstar_suse accepted review
Staging Project openSUSE:Factory:Staging:D got accepted.
dimstar_suse approved review
Staging Project openSUSE:Factory:Staging:D got accepted.
dimstar_suse accepted request
Staging Project openSUSE:Factory:Staging:D got accepted.