Created
April 17, 2018 10:43
-
-
Save noerw/68ea9fbdeb091d41aa05aac661415256 to your computer and use it in GitHub Desktop.
fetch all pages of a doku wiki install (given a filelisting)
This file contains 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 | |
base=/var/www/intern/data/pages | |
doku='https://DOKUWIKIHOST/doku.php?id=' | |
filelist=`find $base -type f -name '*.txt'` | |
echo -e "gonna fetch `wc -w <<< $filelist` pages!11!!\n" | |
for file in $filelist; do | |
url=${file#*pages/} # truncate base dir | |
url=${url%\.txt} # truncate .txt | |
url=${url//\//:} # replace / with : | |
echo -e "fetching page $url\n$doku$url\n`curl -LIsS $doku$url | grep HTTP`\n" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment