Skip to content

Instantly share code, notes, and snippets.

@Akellacom
Created September 26, 2015 16:24
Show Gist options
  • Save Akellacom/065b4925703773dc3b87 to your computer and use it in GitHub Desktop.
Save Akellacom/065b4925703773dc3b87 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -z $1 ]
then
echo "Usage: $0 path/2/proxy.list"
exit 1
fi
cat "$1" | while read line
do
host=`echo $line | sed 's/:[0-9]*.//'`
if [ ! -z `ping -c1 -W0 $host > /dev/null && echo 'alive'` ]
then
echo $line >> work_proxy.list
fi
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment