diff --git a/G1BILLETS.sh b/G1BILLETS.sh index 62931f2..a4dcec3 100755 --- a/G1BILLETS.sh +++ b/G1BILLETS.sh @@ -23,47 +23,48 @@ NBbillets=6 [[ "$STYLE" == "xbian" ]] && NBbillets=1 ## STYLE=xbian => 1 BILLET [[ "$STYLE" == "1" ]] && NBbillets=1 && STYLE="" ## 1 BILLET PDF [[ "$STYLE" == "ticket" ]] && NBbillets=1 && echo "TICKET" ## 1 BILLET JPG +[[ "$STYLE" == "astro" ]] && NBbillets=1 # CHECK IF $STYLE IMAGES EXIST -[[ ! -f ${MY_PATH}/images/fond${STYLE}.jpg ]] && exit 1 -[[ ! -f ${MY_PATH}/images/g1${STYLE}.png ]] && exit 1 -[[ ! -f ${MY_PATH}/images/logo${STYLE}.png ]] && exit 1 +[[ ! -f ${MY_PATH}/images/fond${STYLE}.jpg ]] && echo "missing fond${STYLE}.jpg" && exit 1 +[[ ! -f ${MY_PATH}/images/g1${STYLE}.png ]] && echo "missing g1${STYLE}.jpg" && exit 1 +[[ ! -f ${MY_PATH}/images/logo${STYLE}.png ]] && echo "missing logo${STYLE}.jpg" && exit 1 # CREATION DE $NBbillets BILLETS DE $MONTANT DU boucle=0; while [ $boucle -lt $NBbillets ] do - boucle=$((boucle+1)) - NUMBER=$(${MY_PATH}/diceware.sh 4 | xargs) - SECRET=$(${MY_PATH}/diceware.sh 4 | xargs) + boucle=$((boucle+1)) + NUMBER=$(${MY_PATH}/diceware.sh 4 | xargs) + SECRET=$(${MY_PATH}/diceware.sh 4 | xargs) + + # CREATION CLEF BILLET + BILLETPUBKEY=$(python3 ${MY_PATH}/key_create_dunikey.py "$NUMBER" "$SECRET") + rm -f /tmp/secret.dunikey - # CREATION CLEF BILLET - BILLETPUBKEY=$(python3 ${MY_PATH}/key_create_dunikey.py "$NUMBER" "$SECRET") - rm -f /tmp/secret.dunikey - mkdir -p "/tmp/g1billet/${UNIQID}" - # CREATION FICHIER IMAGE BILLET - $(${MY_PATH}/MAKE_G1BILLET.sh "${NUMBER}" "${SECRET}" "${MONTANT}" "${BILLETPUBKEY}" "${UNIQID}" "${STYLE}") - + # CREATION FICHIER IMAGE BILLET + $(${MY_PATH}/MAKE_G1BILLET.sh "${NUMBER}" "${SECRET}" "${MONTANT}" "${BILLETPUBKEY}" "${UNIQID}" "${STYLE}") + done -if [[ "${STYLE}" == "ticket" || "${STYLE}" == "xbian" ]] +if [[ "${STYLE}" == "ticket" || "${STYLE}" == "xbian" || "${STYLE}" == "astro" ]] then - cp /tmp/g1billet/${UNIQID}/*.jpg /tmp/g1billet/${UNIQID}.jpg - # CLEANING TEMP FILES - rm -Rf /tmp/g1billet/${UNIQID} - # ALLOWS ANY USER TO DELETE - chmod 777 /tmp/g1billet/${UNIQID}.jpg + cp /tmp/g1billet/${UNIQID}/*.jpg /tmp/g1billet/${UNIQID}.jpg + # CLEANING TEMP FILES + rm -Rf /tmp/g1billet/${UNIQID} + # ALLOWS ANY USER TO DELETE + chmod 777 /tmp/g1billet/${UNIQID}.jpg else - # MONTAGE DES IMAGES DES BILLETS VERS /tmp/g1billet/${UNIQID}.pdf - montage /tmp/g1billet/${UNIQID}/*.jpg -tile 2x3 -geometry 964x459 /tmp/g1billet/${UNIQID}.pdf - # NB!! if "not autorized" then edit /etc/ImageMagick-6/policy.xml and comment - # - # CLEANING TEMP FILES - rm -Rf /tmp/g1billet/${UNIQID} - # ALLOWS ANY USER TO DELETE - chmod 777 /tmp/g1billet/${UNIQID}.pdf + # MONTAGE DES IMAGES DES BILLETS VERS /tmp/g1billet/${UNIQID}.pdf + montage /tmp/g1billet/${UNIQID}/*.jpg -tile 2x3 -geometry 964x459 /tmp/g1billet/${UNIQID}.pdf + # NB!! if "not autorized" then edit /etc/ImageMagick-6/policy.xml and comment + # + # CLEANING TEMP FILES + rm -Rf /tmp/g1billet/${UNIQID} + # ALLOWS ANY USER TO DELETE + chmod 777 /tmp/g1billet/${UNIQID}.pdf fi diff --git a/images/aaafondastro.jpg b/images/aaafondastro.jpg new file mode 100644 index 0000000..2b48e9a Binary files /dev/null and b/images/aaafondastro.jpg differ diff --git a/images/fondastro.jpg b/images/fondastro.jpg new file mode 100644 index 0000000..5c98d53 Binary files /dev/null and b/images/fondastro.jpg differ diff --git a/images/fondjeu (copie).jpg b/images/fondjeu (copie).jpg new file mode 100644 index 0000000..d04925b Binary files /dev/null and b/images/fondjeu (copie).jpg differ diff --git a/images/fondsaubole.jpg b/images/fondsaubole.jpg new file mode 100644 index 0000000..fa81a97 Binary files /dev/null and b/images/fondsaubole.jpg differ diff --git a/images/g1astro.png b/images/g1astro.png new file mode 100644 index 0000000..f1cd5ac Binary files /dev/null and b/images/g1astro.png differ diff --git a/images/g1xbian.png b/images/g1xbian.png index dce1c39..090d71a 100644 Binary files a/images/g1xbian.png and b/images/g1xbian.png differ diff --git a/images/logoastro.png b/images/logoastro.png new file mode 100644 index 0000000..2b96838 Binary files /dev/null and b/images/logoastro.png differ