Created
December 23, 2019 17:46
-
-
Save khanjanny/151dd881d740b6bda26e0d19b4ff7810 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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