From 014bdf911a11b0e40c79808cc694fa2d88ec4eb5 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Mon, 26 Sep 2016 20:39:39 -0700 Subject: [PATCH] Add open port detection --- advanced/Scripts/piholeDebug.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index acdb699a..7e08b24e 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -81,6 +81,15 @@ function versionCheck { else echo "lighttpd not installed." >> ${DEBUG_LOG} fi + + echo "::: Writing PHP version to logfile." + php_ver=$(php -v | head -n1) + if [ -n php_ver ] + then + echo "${php_ver}" >> ${DEBUG_LOG} + else + echo "PHP not installed." >> ${DEBUG_LOG} + fi echo >> ${DEBUG_LOG} } @@ -151,6 +160,17 @@ function hostnameCheck { fi } +function portCheck { + echo "############################################################" >> ${DEBUG_LOG} + echo "######## Open Port Information #########" >> ${DEBUG_LOG} + echo "############################################################" >> ${DEBUG_LOG} + + echo "::: Writing local server ports to logfile" + + ${SUDO} netstat -tulpn >> ${DEBUG_LOG} + echo >> ${DEBUG_LOG} +} + function compareWhitelist { if [ ! -f "$WHITELISTMATCHES" ]; then ${SUDO} touch ${WHITELISTMATCHES} @@ -269,6 +289,7 @@ versionCheck distroCheck ipCheck hostnameCheck +portCheck compareWhitelist compareBlacklist testNslookup