日本語名を含む redmine wikiページをpdf で一括でdownloadするshell
前回のポスト
redmine wiki の pdf を shell で download する
http://blog.e2info.com/2013/05/09/redmain-wiki-pdf-dl/
の続編です
以下、shellです
—-
#!/bin/bash # download all wiki page as pdf of your project # befor your run this shell, you need to generate below three files. # # $ openssl pkcs12 -in /path/to/your.p12 -out xca.pem -cacerts -nokeys # Enter Import Password: <-- password for your.p12 # MAC verified OK # # $ openssl pkcs12 -in /path/to/your.p12 -out xclient.pem -clcerts -nokeys # Enter Import Password: <-- password for your.p12 # MAC verified OK # # $ openssl pkcs12 -in /path/to/your.p12 -out xkey.pem -nocerts # Enter Import Password: <-- password for your.p12 # MAC verified OK # Enter PEM pass phrase: <-- password for xkey.pem xxxx # Verifying - Enter PEM pass phrase: <-- retype password BATLIST=`cat << __BAT-LIST__ 日本語名を含むwikiページ名その1 日本語名を含むwikiページ名その2 __BAT-LIST__ ` USR=your-redmine-usr PWD=your-redmine-pwd CLPWD=xxxx # get session curl -c xcookie.txt -d "username=$USR" -d "password=$PWD" --key xkey.pem --cacert xca.pem --cert xclient.pem:$CLPWD --insecure https://redmine.e2info.com/login function urlenc() { echo "$1" | perl -MURI::Escape -lne 'print uri_escape($_)' } function dlpdf() { echo $1 $2 curl -b xcookie.txt --key xkey.pem --cacert xca.pem --cert xclient.pem:$CLPWD --insecure https://redmine.e2info.com/projects/your-project/wiki/$2.pdf > $1.pdf } for BAT in echo $BATLIST do BATENC=$(urlenc $BAT) dlpdf $BAT $BATENC done
—