Skip to content

Instantly share code, notes, and snippets.

@noerw
Created April 17, 2018 10:43
Show Gist options
  • Save noerw/68ea9fbdeb091d41aa05aac661415256 to your computer and use it in GitHub Desktop.
Save noerw/68ea9fbdeb091d41aa05aac661415256 to your computer and use it in GitHub Desktop.
fetch all pages of a doku wiki install (given a filelisting)
#!/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