Skip to content

Instantly share code, notes, and snippets.

@khanjanny
Created December 23, 2019 17:46
Show Gist options
  • Save khanjanny/151dd881d740b6bda26e0d19b4ff7810 to your computer and use it in GitHub Desktop.
Save khanjanny/151dd881d740b6bda26e0d19b4ff7810 to your computer and use it in GitHub Desktop.
#!/bin/bash
file_lines=$(cat $1)
echo "Running LinkFinder over these urls..."
for line in $file_lines
do
if [[ "$line" == "http"* ]]
then
if [[ $(wget $line -O-) ]] 2>/dev/null
then
linkfinder -i `echo $line` -o $(echo `pwd`)"/"$(echo `echo "$line"` | md5sum | sed -e 's/^\(.\{32\}\).*/\1/')".html" &>/dev/null
echo $line
fi
else
if [[ $(wget http://$line -O-) ]] 2>/dev/null
then
linkfinder -i `echo http://$line` -o $(echo `pwd`)"/"$(echo `echo "$line"` | md5sum | sed -e 's/^\(.\{32\}\).*/\1/')".html" &>/dev/null
echo "http://$line"
fi
if [[ $(wget https://$line -O-) ]] 2>/dev/null
then
linkfinder -i `echo https://$line` -o $(echo `pwd`)"/"$(echo `echo "$line"` | md5sum | sed -e 's/^\(.\{32\}\).*/\1/')".html" &>/dev/null
echo "https://$line"
fi
fi
done
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment