#!/bin/sh

set -e

LOCAL_HOST=127.0.0.1

# Scan all ports in the local host for WEB server
pnscan -w"HEAD / HTTP/1.0\r\n\r\n" -r"Server:" $LOCAL_HOST 1:65525

if [ x"$?" != x"0" ]; then
	echo "Error in scanning WEB server on all ports"
	exit 1
fi

# Scan the local host on SSH port
pnscan $LOCAL_HOST 22

if [ x"$?" != x"0" ]; then
	echo "Error in scanning the local host on SSH port"
	exit 1
fi
