bstinson / centos / t_functional

Forked from centos/t_functional 3 years ago
Clone

Blame tests/p_nmap/nmap_test_eth0.sh

Christoph Galuschka dd7235
#!/bin/sh
Christoph Galuschka dd7235
# Author: Christoph Galuschka <christoph.galuschka@chello.at>
Christoph Galuschka dd7235
Christoph Galuschka dd7235
t_Log "Running $0 - nmap querys eth0 and checks for open ssh-port"
Christoph Galuschka dd7235
Christoph Galuschka dd7235
# Grabing IP of eth0
Christoph Galuschka dd7235
IP=$(ip -f inet addr list eth0 | grep 'inet ')
Christoph Galuschka dd7235
regex='.*inet\ (.*)\/.*'
Christoph Galuschka dd7235
if [[ $IP =~ $regex ]]
Christoph Galuschka dd7235
  then
Christoph Galuschka dd7235
  t_Log "Found eth0 IP - starting nmap test"
Christoph Galuschka dd7235
  nmap ${BASH_REMATCH[1]} | grep -iq ssh
Christoph Galuschka dd7235
fi
Christoph Galuschka dd7235
Christoph Galuschka dd7235
t_CheckExitStatus $?