Skip to content

Instantly share code, notes, and snippets.

@johnsom
Created August 1, 2016 17:01
Show Gist options
  • Save johnsom/d9e45a1bcaa52b567afc9b233518eb65 to your computer and use it in GitHub Desktop.
Save johnsom/d9e45a1bcaa52b567afc9b233518eb65 to your computer and use it in GitHub Desktop.
#!/bin/sh
MYIP=$(/sbin/ifconfig eth0|grep 'inet addr'|awk -F: '{print $2}'| awk '{print $1}');
COUNT=0
while true; do
echo -e "HTTP/1.0 200 OK\r\n\r\nWelcome to $MYIP connection $COUNT" | sudo nc -l -p 80 -w 1
if [ $? == 0 ]; then
let "COUNT++"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment