diff --git a/G1BILLETS.sh b/G1BILLETS.sh index e3bd404..2e38b12 100755 --- a/G1BILLETS.sh +++ b/G1BILLETS.sh @@ -12,7 +12,7 @@ ME="${0##*/}" [[ -d ${MY_PATH}/_images/_/ ]] \ && IMAGES="_images" \ || IMAGES="images" -echo "USING ${IMAGES} STYLES" + ################################################################################ # Create different king of G1BILLET(s) with $MONTANT DU or TW IPNS + G1PASS @@ -33,19 +33,21 @@ if [[ $MONTANT != "daemon" ]]; then [[ $DICE != ?(-)+([0-9]) ]] && DICE=$(cat $MY_PATH/DICE 2>/dev/null) ## HOW MANY WORDS SECRETS [[ $DICE != ?(-)+([0-9]) ]] && DICE=4 - echo "SECRETS : $DICE WORDS" + echo "G1BILLET FACTORY MONTANT=$MONTANT DICE=$DICE" + echo "$STYLE : $MY_PATH/${IMAGES}/$STYLE" ## CHECK IF STYLE IS EMAIL => astro IPFS G1BILLET if [[ "${STYLE}" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]]; then echo "ASTROPORT $STYLE DEDICACE G1PASS" # echo "PLAYER : $STYLE" EMAIL=${STYLE} - STYLE="xbian" + STYLE="$(ls -d ${MY_PATH}/${IMAGES}/xbian* | tail -n 1 | rev | cut -d '/' -f 1 | rev)" fi ## STYLE SELECTED: PDF DE 6 BILLETS OR SINGLE NBbillets=6 - [[ "${STYLE}" != "" ]] && NBbillets=1 + [[ "${STYLE:0:1}" != "_" ]] && NBbillets=1 && MONTANT="___" + [[ ${STYLE} == "" ]] && NBbillets=6 echo "CREATION $NBbillets x G1BILLET - $STYLE - " @@ -53,13 +55,13 @@ if [[ $MONTANT != "daemon" ]]; then [[ ${STYLE} == "" ]] && STYLE="_" # CHECK IF $STYLE IMAGES EXIST - [[ ! -f ${MY_PATH}/${IMAGES}/${STYLE}/g1.png ]] && ERROR="STYLE INCONNU ./${IMAGES}/${STYLE}/g1.png" && echo $ERROR && exit 1 - [[ ! -f ${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg ]] && ERROR="STYLE INCONNU ./${IMAGES}/${STYLE}/fond.jpg" && echo $ERROR && exit 1 - [[ ! -f ${MY_PATH}/${IMAGES}/${STYLE}/logo.png ]] && ERROR="STYLE INCONNU ./${IMAGES}/${STYLE}/logo.png" && echo $ERROR && exit 1 + [[ ! -f ${MY_PATH}/${IMAGES}/${STYLE}/g1.png ]] && ERROR="MISSING ./${IMAGES}/${STYLE}/g1.png - EXIT" && echo $ERROR && exit 1 + [[ ! -f ${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg ]] && ERROR="MISSING ./${IMAGES}/${STYLE}/fond.jpg- EXIT" && echo $ERROR && exit 1 + [[ ! -f ${MY_PATH}/${IMAGES}/${STYLE}/logo.png ]] && ERROR="MISSING ./${IMAGES}/${STYLE}/logo.png- EXIT" && echo $ERROR && exit 1 ## THIS IS THE PASS for G1PASS UNIQID=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-5) - [ $DICE -gt 4 ] && UNIQID=$(${MY_PATH}/diceware.sh 1 | xargs)$(echo "${RANDOM}${RANDOM}" | tail -c-5) + [ $DICE -gt 4 ] && UNIQID=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-7) [ $DICE -gt 6 ] && UNIQID=$(${MY_PATH}/diceware.sh 1 | xargs)$(echo "${RANDOM}${RANDOM}" | tail -c-7) # CREATION DE $NBbillets BILLETS DE $MONTANT DU @@ -108,7 +110,7 @@ if [[ $MONTANT != "daemon" ]]; then # MONTAGE DES IMAGES DES BILLETS VERS ${MY_PATH}/tmp/g1billet/${UNIQID}.pdf montage ${MY_PATH}/tmp/g1billet/${UNIQID}/*.jpg -tile 2x3 -geometry 964x459 ${MY_PATH}/tmp/g1billet/${UNIQID}.pdf # NB!! if "not autorized" then edit /etc/ImageMagick-6/policy.xml and comment - [[ ! -s ${MY_PATH}/tmp/g1billet/${UNIQID}.pdf ]] && echo "Please Correct PDF policy /etc/ImageMagick-6/policy.xml " && exit 1 + [[ ! -s ${MY_PATH}/tmp/g1billet/${UNIQID}.pdf ]] && echo "ERROR PDF NOT FOUND - contact - support@qo-op.com" && exit 1 # # CLEANING TEMP FILES rm -Rf ${MY_PATH}/tmp/g1billet/${UNIQID} @@ -166,11 +168,11 @@ else pre=${stname:0:1} if [[ $pre == "_" ]]; then - OPT="${OPT}" + OPT="${OPT}" elif [[ $pre == "x" ]]; then - OPT="${OPT}" + OPT="${OPT}" else - OPT="${OPT}" + OPT="${OPT}" fi done @@ -209,12 +211,13 @@ function countdown() { } } +

+ '${OPT}' @@ -242,6 +246,7 @@ function countdown() {

+
' function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } diff --git a/MAKE_G1BILLET.sh b/MAKE_G1BILLET.sh index 0da15f8..a29ef66 100755 --- a/MAKE_G1BILLET.sh +++ b/MAKE_G1BILLET.sh @@ -13,6 +13,9 @@ ME="${0##*/}" # ${MY_PATH}/G1BILLET_MAKE.sh "nu me ro test" "se cr et" 100 7sn9dKeCNEsHmqm1gMWNREke4YAWtNw8KG1YBSN8CmSh 97968583 ############################################################################ +## SEND LOG TO ~/.zen/tmp/_12345.log +exec 2>&1 >> ~/.zen/G1BILLET/tmp/G1BILLETS.log + ## LOAD PERSONAL OR DEFAULT STYLES [[ -d ${MY_PATH}/_images/_/ ]] \ && IMAGES="_images" \ @@ -42,43 +45,50 @@ BILLETNAME=$(echo $SALT | sed 's/ /_/g') # Prepare June logo color case "$MONTANT" in 1) - convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill grey -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill grey -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg" ;; 2) - convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill green -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill green -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg" ;; 5) - convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill orange -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill orange -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg" ;; 10) - convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill blue -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill blue -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg" ;; 20) - convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill purple -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill purple -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg" ;; 50) - convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill red -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill red -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg" ;; 100) - convert "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" -fuzz 20% -fill black -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + convert "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" -fuzz 20% -fill black -opaque '#e5912b' "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg" ;; *) - cp "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + cp "${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg" ;; esac -# Add LOGO over FOND -composite -compose Over -gravity SouthWest -geometry +150+50 -dissolve 70% \ +## PREPARE LOGO +cp "${MY_PATH}/${IMAGES}/${STYLE}/g1.png" "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" + +# Add logo.png over FOND +composite -compose Over -dissolve 60% \ "${MY_PATH}/${IMAGES}/${STYLE}/logo.png" \ -"${MY_PATH}/${IMAGES}/${STYLE}/fond.jpg" \ +"${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg" \ "${MY_PATH}/tmp/${BILLETNAME}.jpg" -# "G1PASS" (GPG+TW) STYLE : xbian, xjeu, xastro -if [[ "${STYLE:0:1}" == "x" ]] -then +## NOT TO BE IN FINAL PDF (getting all jpg) +rm "${MY_PATH}/tmp/g1billet/${UNIQID}/fond.jpg" + +if [[ "${STYLE:0:1}" != "_" ]] +then + if [[ ${ASTRONAUTENS} ]]; then + ## ♥Box :: G1PASS + BOTTOM="$(date) :: ♥Box :: G1PASS :: $(hostname) ::" + XZUID="__________@__________" - if [[ $ASTRONAUTENS ]]; then - ## IT IS AN ASTRONAUTENS IPNS LINK USALT=$(echo "$SALT" | jq -Rr @uri) UPEPPER=$(echo "$SECRET" | jq -Rr @uri) echo "(≖‿‿≖) Making gpg of /?salt=${USALT}&pepper=${UPEPPER} with pass=$UNIQID" @@ -103,7 +113,7 @@ then "$DISCO" ## ADD PLAYER EMAIL - convert -gravity southeast -pointsize 28 -fill black -draw "text 5,3 \"$EMAIL\"" ${MY_PATH}/tmp/fond_qrcode.png ${MY_PATH}/tmp/g1billet/${UNIQID}/${BILLETNAME}.G1PASS.png + convert -gravity southeast -pointsize 28 -fill black -draw "text 5,3 \"${EMAIL}\"" ${MY_PATH}/tmp/fond_qrcode.png ${MY_PATH}/tmp/g1billet/${UNIQID}/${BILLETNAME}.G1PASS.png convert ${MY_PATH}/tmp/g1billet/${UNIQID}/${BILLETNAME}.G1PASS.png -resize 300 ${MY_PATH}/tmp/g1billet/${UNIQID}/${BILLETNAME}.TW.png composite -compose Over -gravity SouthWest -geometry +50+50 \ @@ -113,26 +123,28 @@ then rm ${MY_PATH}/tmp/gpg.${BILLETNAME}.asc - if [[ ${STYLE} == "xbian" ]]; then - amzqr "https://ipfs.copylaradio.com/ipns/$ASTRONAUTENS" -l H -p "$MY_PATH/${IMAGES}/moa_net.png" -c -n QRTWavatar.png -d ${MY_PATH}/tmp/g1billet/${UNIQID}/ + if [[ "${STYLE:0:1}" == "x" ]]; then + + [[ "${EMAIL}" != "" ]] && XZUID="${EMAIL}" + ## ♥Box :: G1TW (central IPFS QRCODE) + BOTTOM="$(date) :: ♥Box :: G1TW :: $(hostname) ::" + + amzqr "https://ipfs.copylaradio.com/ipns/${ASTRONAUTENS}" -l H -p "$MY_PATH/${IMAGES}/moa_net.png" -c -n QRTWavatar.png -d ${MY_PATH}/tmp/g1billet/${UNIQID}/ convert ${MY_PATH}/tmp/g1billet/${UNIQID}/QRTWavatar.png -resize 260 ${MY_PATH}/tmp/g1billet/${UNIQID}/300.png - composite -compose Over -gravity Center -geometry +40+40 \ + composite -compose Over -gravity Center -geometry +30+40 \ "${MY_PATH}/tmp/g1billet/${UNIQID}/300.png" \ "${MY_PATH}/tmp/${BILLETNAME}.jpg" \ "${MY_PATH}/tmp/${BILLETNAME}.jpg" + fi fi - # ENTETE ET BAS DE BILLET - XZUID="__________@__________" - BOTTOM="$(date) :: $(hostname) :: ♥Box ::" - else - XZUID="G1 BILLET" - BOTTOM="$(date) :: https://gchange.fr :: https://cesium.app :: $(hostname)" + XZUID="G1BILLET" + BOTTOM="$(date) :: ♥Box :: G1BILLET :: $(hostname) ::" fi @@ -145,8 +157,8 @@ fi "${MY_PATH}/tmp/${BILLETNAME}.jpg" \ "${MY_PATH}/tmp/${BILLETNAME}.jpg" - # Add g1 LOGO to Billet - composite -compose Over -gravity NorthEast -geometry +50+25 -dissolve 90% \ + # Add g1.png SIGLE + composite -compose Over -dissolve 90% \ "${MY_PATH}/tmp/g1billet/${UNIQID}/g1.png" \ "${MY_PATH}/tmp/${BILLETNAME}.jpg" \ "${MY_PATH}/tmp/${BILLETNAME}.jpg" @@ -155,10 +167,10 @@ fi if [[ "$MONTANT" != "___" ]]; then convert -font 'Liberation-Sans' \ -pointsize 40 -fill black -draw 'text 70,50 "'"$XZUID"'"' \ --pointsize 120 -fill black -draw 'text 450,250 "'"$MONTANT"'"' \ --pointsize 20 -fill black -draw 'text 380,20 "'"${NOTERIB}"'"' \ --pointsize 30 -draw 'text 50,100 "'"Identifiant: $SALT"'"' \ --pointsize 22 -fill black -draw 'text 50,130 "'"Code Secret: $SECRET"'"' \ +-pointsize 150 -fill black -draw 'text 120,380 "'"$MONTANT"'"' \ +-pointsize 20 -fill black -draw 'text 340,22 "'"${NOTERIB}"'"' \ +-pointsize 22 -draw 'text 50,100 "'"Secret 1: $SALT"'"' \ +-pointsize 22 -fill black -draw 'text 50,130 "'"Secret 2: $SECRET"'"' \ -pointsize 25 -fill black -draw 'text 50,440 "'"$BOTTOM"'"' \ "${MY_PATH}/tmp/${BILLETNAME}.jpg" "${MY_PATH}/tmp/g1billet/${UNIQID}/${BILLETNAME}.BILLET.jpg" else diff --git a/images/_/g1.png b/images/_/g1.png index 197d05a..ad43c9a 100644 Binary files a/images/_/g1.png and b/images/_/g1.png differ diff --git a/images/_/logo.png b/images/_/logo.png index 84d3d31..6dfac1f 100644 Binary files a/images/_/logo.png and b/images/_/logo.png differ diff --git a/images/jeu/fond.jpg b/images/jeu/fond.jpg new file mode 100644 index 0000000..cafdaee Binary files /dev/null and b/images/jeu/fond.jpg differ diff --git a/images/jeu/g1.png b/images/jeu/g1.png new file mode 100644 index 0000000..758279b Binary files /dev/null and b/images/jeu/g1.png differ diff --git a/images/jeu/logo.png b/images/jeu/logo.png new file mode 100644 index 0000000..2df226c Binary files /dev/null and b/images/jeu/logo.png differ diff --git a/images/saubole/fond.jpg b/images/saubole/fond.jpg index fa81a97..8cd2bb5 100644 Binary files a/images/saubole/fond.jpg and b/images/saubole/fond.jpg differ diff --git a/images/saubole/g1.png b/images/saubole/g1.png index f1cd5ac..7b9a9cf 100644 Binary files a/images/saubole/g1.png and b/images/saubole/g1.png differ diff --git a/images/saubole/logo.png b/images/saubole/logo.png index 51a7ef1..20f1098 100644 Binary files a/images/saubole/logo.png and b/images/saubole/logo.png differ diff --git a/images/solian/g1.png b/images/solian/g1.png deleted file mode 100644 index 4cf126d..0000000 Binary files a/images/solian/g1.png and /dev/null differ diff --git a/images/solian/logo.png b/images/solian/logo.png deleted file mode 100644 index dce1c39..0000000 Binary files a/images/solian/logo.png and /dev/null differ diff --git a/images/ticket/g1.png b/images/ticket/g1.png deleted file mode 100644 index 2dfd996..0000000 Binary files a/images/ticket/g1.png and /dev/null differ diff --git a/images/ticket/logo.png b/images/ticket/logo.png deleted file mode 100644 index 47d32e2..0000000 Binary files a/images/ticket/logo.png and /dev/null differ diff --git a/images/xastro/aaafondastro.jpg b/images/xastro/aaafondastro.jpg deleted file mode 100644 index 2b48e9a..0000000 Binary files a/images/xastro/aaafondastro.jpg and /dev/null differ diff --git a/images/xastro/fond.jpg b/images/xastro/fond.jpg index 8920f0a..c946e0a 100644 Binary files a/images/xastro/fond.jpg and b/images/xastro/fond.jpg differ diff --git a/images/xastro/g1.png b/images/xastro/g1.png index f1cd5ac..f009e0b 100644 Binary files a/images/xastro/g1.png and b/images/xastro/g1.png differ diff --git a/images/xastro/logo.png b/images/xastro/logo.png index 2b96838..8bdf629 100644 Binary files a/images/xastro/logo.png and b/images/xastro/logo.png differ diff --git a/images/xbian/fond.jpg b/images/xbian/fond.jpg deleted file mode 100644 index 8920f0a..0000000 Binary files a/images/xbian/fond.jpg and /dev/null differ diff --git a/images/xbian/g1.png b/images/xbian/g1.png deleted file mode 100644 index 264f8d2..0000000 Binary files a/images/xbian/g1.png and /dev/null differ diff --git a/images/xbian/logo.png b/images/xbian/logo.png deleted file mode 100644 index 0aa90c7..0000000 Binary files a/images/xbian/logo.png and /dev/null differ diff --git a/images/xjeu/fond.jpg b/images/xjeu/fond.jpg deleted file mode 100644 index 4b8646a..0000000 Binary files a/images/xjeu/fond.jpg and /dev/null differ diff --git a/images/xjeu/fondjeu (autre copie).jpg b/images/xjeu/fondjeu (autre copie).jpg deleted file mode 100644 index 87e8117..0000000 Binary files a/images/xjeu/fondjeu (autre copie).jpg and /dev/null differ diff --git a/images/xjeu/fondjeu (copie).jpg b/images/xjeu/fondjeu (copie).jpg deleted file mode 100644 index d04925b..0000000 Binary files a/images/xjeu/fondjeu (copie).jpg and /dev/null differ diff --git a/images/xjeu/g1.png b/images/xjeu/g1.png deleted file mode 100644 index ae8b587..0000000 Binary files a/images/xjeu/g1.png and /dev/null differ diff --git a/images/xjeu/g1jeu (copie).png b/images/xjeu/g1jeu (copie).png deleted file mode 100644 index 91b87be..0000000 Binary files a/images/xjeu/g1jeu (copie).png and /dev/null differ diff --git a/images/xjeu/logo.png b/images/xjeu/logo.png deleted file mode 100644 index 51a7ef1..0000000 Binary files a/images/xjeu/logo.png and /dev/null differ diff --git a/styles/fond/fond_astroport.jpg b/styles/fond/fond_astroport.jpg new file mode 100644 index 0000000..2282f4c Binary files /dev/null and b/styles/fond/fond_astroport.jpg differ diff --git a/images/ticket/fond.jpg b/styles/fond/fond_blanc.jpg similarity index 52% rename from images/ticket/fond.jpg rename to styles/fond/fond_blanc.jpg index 5c98d53..9964a42 100644 Binary files a/images/ticket/fond.jpg and b/styles/fond/fond_blanc.jpg differ diff --git a/styles/fond/fond_jeu.jpg b/styles/fond/fond_jeu.jpg new file mode 100644 index 0000000..cafdaee Binary files /dev/null and b/styles/fond/fond_jeu.jpg differ diff --git a/styles/fond/fond_saubole.jpg b/styles/fond/fond_saubole.jpg new file mode 100644 index 0000000..8cd2bb5 Binary files /dev/null and b/styles/fond/fond_saubole.jpg differ diff --git a/images/solian/fond.jpg b/styles/fond/fond_solian.jpg similarity index 100% rename from images/solian/fond.jpg rename to styles/fond/fond_solian.jpg diff --git a/styles/fond/fond_xbian.jpg b/styles/fond/fond_xbian.jpg new file mode 100644 index 0000000..c946e0a Binary files /dev/null and b/styles/fond/fond_xbian.jpg differ diff --git a/styles/g1/g1_astro_color.png b/styles/g1/g1_astro_color.png new file mode 100644 index 0000000..e2fa581 Binary files /dev/null and b/styles/g1/g1_astro_color.png differ diff --git a/styles/g1/g1_astro_nb.png b/styles/g1/g1_astro_nb.png new file mode 100644 index 0000000..50a76b0 Binary files /dev/null and b/styles/g1/g1_astro_nb.png differ diff --git a/styles/g1/g1_astro_one.png b/styles/g1/g1_astro_one.png new file mode 100644 index 0000000..b85d5a1 Binary files /dev/null and b/styles/g1/g1_astro_one.png differ diff --git a/styles/g1/g1_astroport.png b/styles/g1/g1_astroport.png new file mode 100644 index 0000000..7fe8b9f Binary files /dev/null and b/styles/g1/g1_astroport.png differ diff --git a/styles/g1/g1_nb.png b/styles/g1/g1_nb.png new file mode 100644 index 0000000..e8a8e25 Binary files /dev/null and b/styles/g1/g1_nb.png differ diff --git a/styles/g1/g1_tim.png b/styles/g1/g1_tim.png new file mode 100644 index 0000000..7b9a9cf Binary files /dev/null and b/styles/g1/g1_tim.png differ diff --git a/styles/logo/logo_astroMIZ.png b/styles/logo/logo_astroMIZ.png new file mode 100644 index 0000000..8bdf629 Binary files /dev/null and b/styles/logo/logo_astroMIZ.png differ diff --git a/styles/logo/logo_fanch.png b/styles/logo/logo_fanch.png new file mode 100644 index 0000000..dfcd153 Binary files /dev/null and b/styles/logo/logo_fanch.png differ