bstinson / centos / t_functional

Forked from centos/t_functional 3 years ago
Clone
Blob Blame History Raw
#!/bin/sh
# Author: Christoph Galuschka <christoph.galuschka@chello.at>

t_Log "Running $0 - nmap querys eth0 and checks for open ssh-port"

# Grabing IP of eth0
IP=$(ip -f inet addr list eth0 | grep 'inet ')
regex='.*inet\ (.*)\/.*'
if [[ $IP =~ $regex ]]
  then
  t_Log "Found eth0 IP - starting nmap test"
  nmap ${BASH_REMATCH[1]} | grep -iq ssh
fi

t_CheckExitStatus $?