-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrun.sh
executable file
·61 lines (52 loc) · 2.13 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# move to current directory
ABSPATH=$(cd "$(dirname "$0")"; pwd)
echo $ABSPATH
cd $ABSPATH
WKHTML=./wkhtmltox/bin/wkhtmltopdf
LANGUAGES=( en af ar be bg ca cs da de et el es eo fa eu sq fo fr gl ko sr cy hi hr id it he lt hu nl ja nb pl pt-br pt-pt ro ru sk sl fi sv th vi tr uk zh-hans zh-hant ig )
NID3=278625
LANGUAGE_COUNT=${#LANGUAGES[@]}
INDEX=0
# instal ssh key
openssl aes-256-cbc -K $encrypted_00bb55250e56_key -iv $encrypted_00bb55250e56_iv -in resources/osuosl_nighlies_rsa.enc -out resources/osuosl_nighlies_rsa -d
# Make ssh dir
mkdir $HOME/.ssh/
# Copy over private key, and set permissions
cp resources/osuosl_nighlies_rsa $HOME/.ssh/osuosl_nighlies_rsa
# set permission
chmod 600 $HOME/.ssh/osuosl_nighlies_rsa
# Create known_hosts
touch $HOME/.ssh/known_hosts
# Add osuosl key to known host
ssh-keyscan ftp-osl.osuosl.org >> $HOME/.ssh/known_hosts
eval "$(ssh-agent -s)"
expect << EOF
spawn ssh-add $HOME/.ssh/osuosl_nighlies_rsa
expect "Enter passphrase"
send "${OSUOSL_NIGHTLY_PASSPHRASE}\r"
expect eof
EOF
SSH_INDENTITY=$HOME/.ssh/osuosl_nighlies_rsa
# MuseScore 3
INDEX=0
while [ "$INDEX" -lt "$LANGUAGE_COUNT" ]
do
LANGUAGE=${LANGUAGES[$INDEX]}
echo "update handbook 3 - [$LANGUAGE]"
case ${LANGUAGE} in
pt-br) PDFILE=MuseScore-pt_BR.pdf ;;
pt-pt) PDFILE=MuseScore-pt.pdf ;;
zh-hant) PDFILE=MuseScore-zh_Hant.pdf ;;
zh-hans) PDFILE=MuseScore-zh_CN.pdf ;;
*) PDFILE=MuseScore-${LANGUAGE}.pdf ;;
esac
TIME=$(date +%s)
#echo "https://musescore.org/${LANGUAGE}/print/book/export/html/${NID3}?pdf&no-cache=${TIME}"
$WKHTML --footer-center '[page]' --footer-spacing 2 --title "MuseScore 3 handbook" cover https://musescore.org/${LANGUAGE}/handbook-cover toc --xsl-style-sheet custom.xslt "https://musescore.org/${LANGUAGE}/print/book/export/html/${NID3}?pdf=1&no-cache=${TIME}" $PDFILE > /dev/null 2>&1
scp -C -i $SSH_INDENTITY $PDFILE [email protected]:~/ftp/handbook/MuseScore-3.0/
rm $PDFILE
((INDEX++))
done
# trigger distribution
ssh -i $SSH_INDENTITY [email protected] "~/trigger-musescore-nightlies"