do shell script "
{
echo Network Info for $(hostname):
echo Name server:
dig +short +identify localhost
echo
# if the following returns an ip number then outside internet access is available
echo global ip:
curl -s ifconfig.me
echo
echo ifconfig:
ifconfig
echo
echo netstat summary:
netstat -an | egrep 'LISTEN|ESTABLISHED|CLOSED$'
#ping broadcast address to populate the route tables
ping -c1 $(ifconfig | sed -ne 's/.*broadcast \\(.*\\)/\\1/p') >/dev/null
# print routing table
echo
netstat -nr
} | pbcopy
"
display dialog "Your network information has been copied to your clipboard." buttons {"Ok"} giving up after 20 default button 1
open netinfo2clipboard in the applescript editor