changes
51
G1BILLETS.sh
@ -23,47 +23,48 @@ NBbillets=6
|
|||||||
[[ "$STYLE" == "xbian" ]] && NBbillets=1 ## STYLE=xbian => 1 BILLET
|
[[ "$STYLE" == "xbian" ]] && NBbillets=1 ## STYLE=xbian => 1 BILLET
|
||||||
[[ "$STYLE" == "1" ]] && NBbillets=1 && STYLE="" ## 1 BILLET PDF
|
[[ "$STYLE" == "1" ]] && NBbillets=1 && STYLE="" ## 1 BILLET PDF
|
||||||
[[ "$STYLE" == "ticket" ]] && NBbillets=1 && echo "TICKET" ## 1 BILLET JPG
|
[[ "$STYLE" == "ticket" ]] && NBbillets=1 && echo "TICKET" ## 1 BILLET JPG
|
||||||
|
[[ "$STYLE" == "astro" ]] && NBbillets=1
|
||||||
|
|
||||||
|
|
||||||
# CHECK IF $STYLE IMAGES EXIST
|
# CHECK IF $STYLE IMAGES EXIST
|
||||||
[[ ! -f ${MY_PATH}/images/fond${STYLE}.jpg ]] && exit 1
|
[[ ! -f ${MY_PATH}/images/fond${STYLE}.jpg ]] && echo "missing fond${STYLE}.jpg" && exit 1
|
||||||
[[ ! -f ${MY_PATH}/images/g1${STYLE}.png ]] && exit 1
|
[[ ! -f ${MY_PATH}/images/g1${STYLE}.png ]] && echo "missing g1${STYLE}.jpg" && exit 1
|
||||||
[[ ! -f ${MY_PATH}/images/logo${STYLE}.png ]] && exit 1
|
[[ ! -f ${MY_PATH}/images/logo${STYLE}.png ]] && echo "missing logo${STYLE}.jpg" && exit 1
|
||||||
|
|
||||||
# CREATION DE $NBbillets BILLETS DE $MONTANT DU
|
# CREATION DE $NBbillets BILLETS DE $MONTANT DU
|
||||||
boucle=0;
|
boucle=0;
|
||||||
while [ $boucle -lt $NBbillets ]
|
while [ $boucle -lt $NBbillets ]
|
||||||
do
|
do
|
||||||
boucle=$((boucle+1))
|
boucle=$((boucle+1))
|
||||||
NUMBER=$(${MY_PATH}/diceware.sh 4 | xargs)
|
NUMBER=$(${MY_PATH}/diceware.sh 4 | xargs)
|
||||||
SECRET=$(${MY_PATH}/diceware.sh 4 | xargs)
|
SECRET=$(${MY_PATH}/diceware.sh 4 | xargs)
|
||||||
|
|
||||||
# CREATION CLEF BILLET
|
# CREATION CLEF BILLET
|
||||||
BILLETPUBKEY=$(python3 ${MY_PATH}/key_create_dunikey.py "$NUMBER" "$SECRET")
|
BILLETPUBKEY=$(python3 ${MY_PATH}/key_create_dunikey.py "$NUMBER" "$SECRET")
|
||||||
rm -f /tmp/secret.dunikey
|
rm -f /tmp/secret.dunikey
|
||||||
|
|
||||||
mkdir -p "/tmp/g1billet/${UNIQID}"
|
mkdir -p "/tmp/g1billet/${UNIQID}"
|
||||||
# CREATION FICHIER IMAGE BILLET
|
# CREATION FICHIER IMAGE BILLET
|
||||||
$(${MY_PATH}/MAKE_G1BILLET.sh "${NUMBER}" "${SECRET}" "${MONTANT}" "${BILLETPUBKEY}" "${UNIQID}" "${STYLE}")
|
$(${MY_PATH}/MAKE_G1BILLET.sh "${NUMBER}" "${SECRET}" "${MONTANT}" "${BILLETPUBKEY}" "${UNIQID}" "${STYLE}")
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ "${STYLE}" == "ticket" || "${STYLE}" == "xbian" ]]
|
if [[ "${STYLE}" == "ticket" || "${STYLE}" == "xbian" || "${STYLE}" == "astro" ]]
|
||||||
then
|
then
|
||||||
cp /tmp/g1billet/${UNIQID}/*.jpg /tmp/g1billet/${UNIQID}.jpg
|
cp /tmp/g1billet/${UNIQID}/*.jpg /tmp/g1billet/${UNIQID}.jpg
|
||||||
# CLEANING TEMP FILES
|
# CLEANING TEMP FILES
|
||||||
rm -Rf /tmp/g1billet/${UNIQID}
|
rm -Rf /tmp/g1billet/${UNIQID}
|
||||||
# ALLOWS ANY USER TO DELETE
|
# ALLOWS ANY USER TO DELETE
|
||||||
chmod 777 /tmp/g1billet/${UNIQID}.jpg
|
chmod 777 /tmp/g1billet/${UNIQID}.jpg
|
||||||
else
|
else
|
||||||
# MONTAGE DES IMAGES DES BILLETS VERS /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
|
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
|
# NB!! if "not autorized" then edit /etc/ImageMagick-6/policy.xml and comment
|
||||||
# <!-- <policy domain="coder" rights="none" pattern="PDF" /> -->
|
# <!-- <policy domain="coder" rights="none" pattern="PDF" /> -->
|
||||||
# CLEANING TEMP FILES
|
# CLEANING TEMP FILES
|
||||||
rm -Rf /tmp/g1billet/${UNIQID}
|
rm -Rf /tmp/g1billet/${UNIQID}
|
||||||
# ALLOWS ANY USER TO DELETE
|
# ALLOWS ANY USER TO DELETE
|
||||||
chmod 777 /tmp/g1billet/${UNIQID}.pdf
|
chmod 777 /tmp/g1billet/${UNIQID}.pdf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
BIN
images/aaafondastro.jpg
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
images/fondastro.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
images/fondjeu (copie).jpg
Normal file
After Width: | Height: | Size: 67 KiB |
BIN
images/fondsaubole.jpg
Normal file
After Width: | Height: | Size: 156 KiB |
BIN
images/g1astro.png
Normal file
After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 638 KiB |
BIN
images/logoastro.png
Normal file
After Width: | Height: | Size: 21 KiB |