toolkit/func/core/pkg_lsof/10-test-lsof.sh
2021-07-04 23:50:25 -07:00

15 lines
299 B
Bash
Executable File

#!/bin/bash
r_log "lsof" "Test basic lsof functions"
r_log "lsof" "lsof against sshd"
sshd_port_listen=$(lsof -i:22 | grep LISTEN)
if [ "$sshd_port_listen" ]; then
r_log "lsof" "SSH is listening."
ret_val=0
else
r_log "lsof" "SSH is NOT listening."
ret_val=1
fi
r_checkExitStatus $ret_val