Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- print() {
- printf '%s' "$1"
- }
- println() {
- printf '%s\n' "$1"
- }
- if [ -z "$(which curl)" ]; then
- println 'Curl was not found on your system.'
- println 'Please install it or add the directory it resides in to your PATH.'
- exit 2
- fi
- if [ -d "$2" ]; then
- println 'You have supplied an existing directory as a destination file.'
- println 'Please supply a proper filename or filepath.'
- exit 1
- fi
- if [ -f "$2" ]; then
- rm $2
- fi
- println 'url,status,redirects_to' > $2
- printf 'Started cheacking tumblr blogs from list file %s.\n' $1
- println 'Progress will be displayed in dots.'
- while read -r url; do
- printf '%s,' $url >> $2
- curl -I -L -s -o /dev/null -w '%{http_code},%{url_effective}\n' $url >> $2
- print '.'
- done < $1
- println
- println '[DONE]'
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement