Is there any way to run a command only if another command produces terminal output? I want to run

Code:
netstat --tcp --numeric |  cut -c 45-65 | sort -u | sed '/Foreign/d' | sed '/^$/d' | grep -e ':80' -e ':443'
and if that produces output in the shell then run

Code:
echo 'http / https' && netstat --tcp --numeric |  cut -c 45-65 | sort -u | sed '/Foreign/d' | sed '/^$/d' | grep -e ':80' -e ':443'
but also suppress the output from the original check.

The script that I have so far is

Code:
#! /bin/bash
if netstat --tcp --numeric |  cut -c 45-65 | sort -u | sed '/Foreign/d' | sed '/^$/d' | grep -e ':80' -e ':443' ; then
echo 'http / https' && netstat --tcp --numeric |  cut -c 45-65 | sort -u | sed '/Foreign/d' | sed '/^$/d' | grep -e ':80' -e ':443'
fi


exit
which produces

Code:
24.143.207.65:80     
http / https
24.143.207.65:80
I am still new at this and know that there is something I am missing but I cannot seem to figure it out. I read a bash syntax guide that I found online but I still just don't get it. Any help would be greatly appreciated.