G1Billets and some more
This commit is contained in:
parent
dff65df717
commit
cdcecb2cec
|
@ -8,15 +8,20 @@ source $MY_PATH/../.install/.GPATH
|
||||||
[[ -f $MY_PATH/../.profile ]] && source $MY_PATH/../.profile
|
[[ -f $MY_PATH/../.profile ]] && source $MY_PATH/../.profile
|
||||||
|
|
||||||
## Désactive les processus écoutant le tty1
|
## Désactive les processus écoutant le tty1
|
||||||
[[ $(sudo systemctl status getty@tty1.service | grep "loaded") ]] && sudo systemctl stop getty@tty1.service && sudo systemctl disable getty@tty1.service
|
[[ $(sudo systemctl status getty@tty1.service | grep "loaded" 2>/dev/null) ]] && sudo systemctl stop getty@tty1.service && sudo systemctl disable getty@tty1.service
|
||||||
|
|
||||||
## Copie et sed de /etc/gammu-smsdrc
|
if [[ -z $(grep "PIN" /etc/gammu-smsdrc) ]]; then
|
||||||
[[ -f /etc/gammu-smsdrc ]] && sudo mv /etc/gammu-smsdrc /etc/gammu-smsdrc.old && echo "/etc/gammu-smsdrc a été renommé en /etc/gammu-smsdrc.old"
|
## Copie et sed de /etc/gammu-smsdrc
|
||||||
sudo cp $MY_PATH/templates/2b/gammu-smsdrc /etc/
|
[[ -f /etc/gammu-smsdrc ]] && sudo mv /etc/gammu-smsdrc /etc/gammu-smsdrc.old && echo "/etc/gammu-smsdrc a été renommé en /etc/gammu-smsdrc.old"
|
||||||
|
sudo cp $MY_PATH/templates/2b/gammu-smsdrc /etc/
|
||||||
|
|
||||||
GPATHS=$(echo $GPATH | sed 's./.\\/.g')
|
GPATHS=$(echo $GPATH | sed 's./.\\/.g')
|
||||||
sudo sed -i "s/_GPATH/$GPATHS/g" /etc/gammu-smsdrc
|
sudo sed -i "s/_GPATH/$GPATHS/g" /etc/gammu-smsdrc
|
||||||
sudo sed -i "s/_PIN/$PIN/g" /etc/gammu-smsdrc
|
sudo sed -i "s/_PIN/$PIN/g" /etc/gammu-smsdrc
|
||||||
|
|
||||||
|
## Redémarre gammu-smsd
|
||||||
|
sudo service gammu-smsd restart && echo -e "${c_green}Gammu a été correctement configuré$c_" || echo -e "${c_green}Un problème est survenu lors de la configuration de gammu$c_"
|
||||||
|
fi
|
||||||
|
|
||||||
## Configure correctement le UART
|
## Configure correctement le UART
|
||||||
|
|
||||||
|
@ -28,7 +33,4 @@ sudo sed -i "s/_PIN/$PIN/g" /etc/gammu-smsdrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Redémarre gammu-smsd
|
|
||||||
sudo service gammu-smsd restart && echo -e "${c_green}Gammu a été correctement configuré$c_" || echo -e "${c_green}Un problème est survenu lors de la configuration de gammu$c_"
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
source $MY_PATH/.install/.GPATH
|
if [[ -f $MY_PATH/.install/.GPATH ]]; then source $MY_PATH/.install/.GPATH; fi
|
||||||
|
if [[ -f $MY_PATH/../.install/.GPATH ]]; then source $MY_PATH/../.install/.GPATH; fi
|
||||||
|
|
||||||
# Adapter les valeurs au contexte spatio-temporel du NODE G1SMS
|
# Adapter les valeurs au contexte spatio-temporel du NODE G1SMS
|
||||||
function log () {
|
function log () {
|
||||||
|
|
2
_chain
2
_chain
|
@ -1 +1 @@
|
||||||
QmaN3w2NGxejb8yNN1sP4fvnfDV3YDghStcjbyLr7zchCC
|
QmdKvkQL65ibGXEBXGxZZu9a58udDCZPutC1NZQfFm9sDT
|
||||||
|
|
|
@ -176,3 +176,4 @@ OK
|
||||||
2019-12-17: G1TAG REFRESH & more
|
2019-12-17: G1TAG REFRESH & more
|
||||||
2019-12-18: RAZ
|
2019-12-18: RAZ
|
||||||
2019-12-20: NOW
|
2019-12-20: NOW
|
||||||
|
2019-12-21: Various
|
||||||
|
|
BIN
_publishkey.gpg
BIN
_publishkey.gpg
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 77 KiB |
BIN
shell/G1sms.png
BIN
shell/G1sms.png
Binary file not shown.
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 253 KiB After Width: | Height: | Size: 253 KiB |
|
@ -97,3 +97,12 @@ if [[ "$1" == "KALKUN" ]]; then
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
|
##################################################################
|
||||||
|
if [[ "$1" == "TAG" ]]; then
|
||||||
|
##################################################################
|
||||||
|
for tag in ./TAG/*; do
|
||||||
|
echo $tag
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
##################################################################
|
||||||
|
|
|
@ -21,7 +21,7 @@ function sms_SEND () {
|
||||||
if [[ ${#dest} -eq 10 || ${#dest} -eq 12 ]]; then
|
if [[ ${#dest} -eq 10 || ${#dest} -eq 12 ]]; then
|
||||||
if [[ -d ./wallets/$dest ]]; then
|
if [[ -d ./wallets/$dest ]]; then
|
||||||
# TEST IF $dest IS ON CURRENT NODE
|
# TEST IF $dest IS ON CURRENT NODE
|
||||||
gammu-smsd-inject -l TEXT "$dest" -text "$mess" 1>&2
|
gammu-smsd-inject TEXT "$dest" -text "$mess" 1>&2
|
||||||
else
|
else
|
||||||
# Send SMS through $dest NODE (TODO: send it like PRINT, TASK, ...)
|
# Send SMS through $dest NODE (TODO: send it like PRINT, TASK, ...)
|
||||||
DESTNODEID=$(cat ./wallets_swarm/$dest/MASTERPHONE.ipfsid)
|
DESTNODEID=$(cat ./wallets_swarm/$dest/MASTERPHONE.ipfsid)
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
##################################################################
|
##################################################################
|
||||||
# Author: poka (support@qo-op.com)
|
# Author: Fred (support@qo-op.com)
|
||||||
# Version: 0.1
|
# Version: 0.1
|
||||||
# License: GPL (http://www.google.com/search?q=GPL)
|
# License: GPL (http://www.google.com/search?q=GPL)
|
||||||
##################################################################
|
##################################################################
|
||||||
# Adapter les valeurs au contexte spatio-temporel du NODE G1SMS
|
|
||||||
|
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
source $MY_PATH/../.install/.GPATH
|
source $MY_PATH/.install/.GPATH
|
||||||
|
|
||||||
|
# Adapter les valeurs au contexte spatio-temporel du NODE G1SMS
|
||||||
function log () {
|
function log () {
|
||||||
# log ($1=text)
|
# log ($1=text)
|
||||||
if [ "$DOLOG" == "YES" ]
|
if [ "$DOLOG" == "YES" ]
|
||||||
|
@ -35,7 +35,7 @@ export G1SMS="YES"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
export YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1)
|
export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1);
|
||||||
cd $GPATH
|
cd $GPATH
|
||||||
##################################################################
|
##################################################################
|
||||||
# Activate logging to /tmp/g1sms.log (YES/NO)
|
# Activate logging to /tmp/g1sms.log (YES/NO)
|
||||||
|
@ -65,13 +65,13 @@ fi
|
||||||
export NODECOMM=10
|
export NODECOMM=10
|
||||||
##################################################################
|
##################################################################
|
||||||
# SMS SIM Card Phone Number
|
# SMS SIM Card Phone Number
|
||||||
export MASTERPHONE="+3368818767"
|
export MASTERPHONE="+33651136520"
|
||||||
export ADRESSE="Blois"
|
export ADRESSE="G1_Fablab_Toulouse"
|
||||||
export G1DAB="NO"
|
export G1DAB="NO"
|
||||||
##################################################################
|
##################################################################
|
||||||
# ADMIN COMMAND PHONE ORIGIN
|
# ADMIN COMMAND PHONE ORIGIN
|
||||||
export ADMINPHONE="+33650573417"
|
export ADMINPHONE="+33647683646"
|
||||||
export ADMINPSEUDO="poka"
|
export ADMINPSEUDO="Fred"
|
||||||
##################################################################
|
##################################################################
|
||||||
# DUNITER/CESIUM+ DEFAULT SERVERS
|
# DUNITER/CESIUM+ DEFAULT SERVERS
|
||||||
export DUNITER="https://g1.duniter.org"
|
export DUNITER="https://g1.duniter.org"
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
|
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
source $MY_PATH/../.install/.GPATH
|
if [[ -f $MY_PATH/.install/.GPATH ]]; then source $MY_PATH/.install/.GPATH; fi
|
||||||
|
if [[ -f $MY_PATH/../.install/.GPATH ]]; then source $MY_PATH/../.install/.GPATH; fi
|
||||||
|
|
||||||
YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1)
|
YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1)
|
||||||
# TODO Make it directory independant. (for now it is tested for pi running ipfs and code in $HOME/G1sms+
|
# TODO Make it directory independant. (for now it is tested for pi running ipfs and code in $HOME/G1sms+
|
||||||
|
@ -36,7 +37,10 @@ else
|
||||||
echo "${GPATH}/g1sms.pub.key"
|
echo "${GPATH}/g1sms.pub.key"
|
||||||
echo "${GPATH}/g1sms.priv.key"
|
echo "${GPATH}/g1sms.priv.key"
|
||||||
echo "Contactez nous sur https://g1sms.fr"
|
echo "Contactez nous sur https://g1sms.fr"
|
||||||
|
log "${GPATH}/g1sms.pub.key"
|
||||||
|
log "${GPATH}/g1sms.priv.key"
|
||||||
gammu-smsd-inject -l TEXT "$ADMINPHONE" -text "Clef de G1Wallet du SWARM g1sms.priv.key manquante! contactez-nous pour la recevoir https://g1sms.fr" 1>&2
|
gammu-smsd-inject -l TEXT "$ADMINPHONE" -text "Clef de G1Wallet du SWARM g1sms.priv.key manquante! contactez-nous pour la recevoir https://g1sms.fr" 1>&2
|
||||||
|
gammu-smsd-inject -l TEXT "$ADMINPHONE" -text "Debug: ${GPATH}/g1sms.pub.key et ${GPATH}/g1sms.priv.key" 1>&2
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ source ./shell/init.sh
|
||||||
source ./shell/functions.sh
|
source ./shell/functions.sh
|
||||||
|
|
||||||
# Existence days number can be $1
|
# Existence days number can be $1
|
||||||
if [[ "$1" ]]; then vieux="$1"; else vieux=180; fi
|
if [[ "$1" ]]; then vieux="$1"; else vieux=210; fi
|
||||||
if [[ "$2" ]]; then dest="$2"; else dest=$MASTERPUB; fi
|
if [[ "$2" ]]; then dest="$2"; else dest=$MASTERPUB; fi
|
||||||
|
|
||||||
echo "Recherche de G1Billets plus vieux que $vieux jours."
|
echo "Recherche de G1Billets plus vieux que $vieux jours."
|
||||||
|
|
|
@ -59,38 +59,43 @@ testmin=$( echo "${VIR} < ${MIN}" | bc -l )
|
||||||
log "TEST : $VIR < $MIN ? $testmin"
|
log "TEST : $VIR < $MIN ? $testmin"
|
||||||
|
|
||||||
# silkaj NODE CHANGE !!!
|
# silkaj NODE CHANGE !!!
|
||||||
SILKAJNODE=$(./shell/checknodes.sh)
|
#SILKAJNODE=$(./shell/checknodes.sh)
|
||||||
log "NEW SILKAJ NODE: $SILKAJNODE"
|
#log "NEW SILKAJ NODE: $SILKAJNODE"
|
||||||
|
|
||||||
if [[ "$testmin" -eq "1" ]]
|
if [[ "$testmin" -eq "1" ]]
|
||||||
then
|
then
|
||||||
|
# Clean MEMBER directory
|
||||||
|
rm -f ./billets/MEMBERS/$MEMBER/*.jpg
|
||||||
boucle=0;
|
boucle=0;
|
||||||
while [ $boucle -lt $NBbillets ]
|
while [ $boucle -lt $NBbillets ]
|
||||||
do
|
do
|
||||||
# Creation du numéro de billet
|
# Creation du numéro de billet
|
||||||
NUMBER=$(./shell/diceware.sh 4 | xargs)
|
NUMBER=$(./shell/diceware.sh 2 | xargs)
|
||||||
bpath=$(echo $NUMBER | sed 's/ /_/g')
|
bpath=$(echo $NUMBER | sed 's/ /_/g')
|
||||||
|
|
||||||
# Cas d'un billet existant
|
# Cas d'un billet existant
|
||||||
while [ -d "./billets/$bpath" ]
|
while [ -d "./billets/$bpath" ]
|
||||||
do
|
do
|
||||||
NUMBER=$(./shell/diceware.sh 4 | xargs)
|
NUMBER=$(./shell/diceware.sh 2 | xargs)
|
||||||
bpath=$(echo $NUMBER | sed 's/ /_/g')
|
bpath=$(echo $NUMBER | sed 's/ /_/g')
|
||||||
done
|
done
|
||||||
|
|
||||||
SECRET=$(./shell/diceware.sh 3 | xargs)
|
SECRET=$(./shell/diceware.sh 3 | xargs)
|
||||||
SALT=$(./shell/diceware.sh 3 | xargs)
|
|
||||||
|
# ADD/REMOVE G1sms forced control over G1Billet
|
||||||
|
# SALT=$(./shell/diceware.sh 3 | xargs)
|
||||||
|
SALT=""
|
||||||
|
|
||||||
boucle=$(bc -l <<< "$boucle + 1")
|
boucle=$(bc -l <<< "$boucle + 1")
|
||||||
|
|
||||||
log "->BILLET:$PHONE:$NUMBER:$VALbillet:$UNIT"
|
log "->BILLET:$PHONE:$NUMBER:$VALbillet:$UNIT"
|
||||||
# CREATE "NUMBER SECRET SALT" ACCOUNT for G1 transfert
|
# CREATE "NUMBER SECRET SALT" ACCOUNT for G1 transfert
|
||||||
TRANSAC=$(bc -l <<< "scale=2; $VIR / $NBbillets")
|
TRANSAC=$(bc -l <<< "scale=2; $VIR / $NBbillets")
|
||||||
BILLETPUBKEY=$(./silkaj/silkaj generate_auth_file --auth-scrypt -salt="$NUMBER" -password="$SECRET $SALT")
|
BILLETPUBKEY=$(./silkaj/silkaj generate_auth_file --auth-scrypt -salt="$NUMBER" -password="$SECRET$SALT")
|
||||||
log_history $PHONE "BILLET, $TRANSAC, $BILLETPUBKEY"
|
log_history $PHONE "BILLET, $TRANSAC, $BILLETPUBKEY"
|
||||||
sleep 3
|
sleep 3
|
||||||
# Fill BILLET with TRANSAC amount
|
# Fill BILLET with TRANSAC amount
|
||||||
PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$TRANSAC" --output="$BILLETPUBKEY" --comment="THIRD_PARTY_MANAGER:$MASTERPUB:G1SMS:BILLET" -y)
|
PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$TRANSAC" --output="$BILLETPUBKEY" --comment="G1Billet $NUMBER" -y)
|
||||||
if [[ "$(echo $PAY | cut -d '|' -f 1)" != "KO" ]]; then
|
if [[ "$(echo $PAY | cut -d '|' -f 1)" != "KO" ]]; then
|
||||||
mkdir -p "./billets/$bpath"
|
mkdir -p "./billets/$bpath"
|
||||||
# NOTES ARE FILES STORED IN DICEWARE COMPOSED SUBDIR
|
# NOTES ARE FILES STORED IN DICEWARE COMPOSED SUBDIR
|
||||||
|
@ -105,14 +110,16 @@ then
|
||||||
log "Remplissage: $TRANSAC G1... $BILLETPUBKEY = $PAY"
|
log "Remplissage: $TRANSAC G1... $BILLETPUBKEY = $PAY"
|
||||||
|
|
||||||
# CREATION FICHIER IMAGE BILLET
|
# CREATION FICHIER IMAGE BILLET
|
||||||
$(./shell/sms_BILLET_MAKE.sh "$NUMBER" "$SECRET" "$VALbillet" "$UNIT" "$DUFACTOR" "$BILLETPUBKEY" "$MEMBER" "$TRANSAC")
|
$(./shell/sms_BILLET_MAKE.sh "$NUMBER" "$SECRET" "$VALbillet" "$UNIT" "$TRANSAC" "$BILLETPUBKEY" "$MEMBER" "$TRANSAC" "$PHONE")
|
||||||
log "./shell/sms_BILLET_MAKE.sh \"$NUMBER\" \"$SECRET\" \"$VALbillet\" \"$UNIT\" \"$DUFACTOR\" \"$BILLETPUBKEY\" \"$MEMBER\" \"$TRANSAC\""
|
log "./shell/sms_BILLET_MAKE.sh \"$NUMBER\" \"$SECRET\" \"$VALbillet\" \"$UNIT\" \"$TRANSAC\" \"$BILLETPUBKEY\" \"$MEMBER\" \"$TRANSAC\" \"$PHONE\""
|
||||||
|
|
||||||
# Transaction to create Link BILLET <-> MEMBER RIB => Decrease BILLET value !
|
# Transaction to create Link BILLET <-> MEMBER RIB => Decrease BILLET value !
|
||||||
sleep 2
|
sleep 2
|
||||||
# PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$NUMBER" -password="$SECRET $SALT" --amount="0.05" --output="$MEMRIB" --comment="THIRD_PARTY_MANAGER:$MASTERPUB:G1SMS:BILLET:$VALbillet:$UNIT:$NUMBER" -y)
|
# PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$NUMBER" -password="$SECRET $SALT" --amount="0.05" --output="$MEMRIB" --comment="THIRD_PARTY_MANAGER:$MASTERPUB:G1SMS:BILLET:$VALbillet:$UNIT:$NUMBER" -y)
|
||||||
else
|
else
|
||||||
sms_ERROR "$PHONE" "Un problème est survenu. Contactez $ADMINPSEUDO au $ADMINPHONE"
|
sms_ERROR "$PHONE" "Un problème est survenu. Contactez $ADMINPSEUDO au $ADMINPHONE"
|
||||||
|
log "ERROR SILKAJ"
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -120,22 +127,26 @@ then
|
||||||
sleep 2
|
sleep 2
|
||||||
COM=$(./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$BILLCOM" --output="$MASTERPUB" --comment="[G1SMS] G1billet Commission" -y)
|
COM=$(./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$BILLCOM" --output="$MASTERPUB" --comment="[G1SMS] G1billet Commission" -y)
|
||||||
|
|
||||||
# IMPRIMER LES BILLETS! Brancher votre imprimante et configurer cups avant ;)
|
# POUR IMPRIMER LES BILLETS! Brancher votre imprimante, configurer cups, activer code lp ;)
|
||||||
num=$(date +%Y%m%d)
|
num=$(date +%Y%m%d)
|
||||||
log "PRINT $num $MEMBER"
|
log "PRINT $num $MEMBER"
|
||||||
montage ./billets/MEMBERS/$MEMBER/*.jpg -tile 2x3 -geometry 964x459 /tmp/$PHONE_Bills_$bpath.pdf
|
montage ./billets/MEMBERS/$MEMBER/*.jpg -tile 2x3 -geometry 964x459 /tmp/$PHONE_Bills_$bpath.pdf && rm -f ./billets/MEMBERS/$MEMBER/*.jpg && log "PDF made /tmp/$PHONE_Bills_$bpath.pdf"
|
||||||
# lp /tmp/$PHONE_Bills_$bpath.pdf
|
zip /tmp/$PHONE_Bills_$bpath.zip /tmp/$PHONE_Bills_$bpath.pdf && rm -f /tmp/$PHONE_Bills_$bpath.pdf && log "Zip done. Remove PDF"
|
||||||
cp /tmp/$PHONE_Bills_$bpath.pdf ./billets/MEMBERS/$MEMBER/
|
|
||||||
zip ./_Bill_$MEMBER_$num.zip ./billets/MEMBERS/$MEMBER/*.jpg && rm -f ./billets/MEMBERS/$MEMBER/*.jpg
|
|
||||||
|
|
||||||
# SEND EMAIL
|
|
||||||
# Détruit ce mail et le pdf après impression et fabrication des billets au code caché.
|
|
||||||
# Créer la monnaie implique une grande responsabilité!
|
|
||||||
|
|
||||||
|
# SEND EMAIL ZIP attached
|
||||||
|
echo "Commande #$NANODATE/$bpath
|
||||||
|
>> Planche de 6 G1Billets : $VALbillet LOVE <<
|
||||||
|
Ecrivez-nous vos remarques...
|
||||||
|
Cesium: https://cesium.app
|
||||||
|
SMS: https://g1sms.fr" > /tmp/message_body.txt
|
||||||
|
mpack -s "[G1sms+]_G1Billets ($bpath) Imprimer + Scotch à gratter! Détruire cet email..." -d /tmp/message_body.txt /tmp/$PHONE_Bills_$bpath.zip $MAIL && rm /tmp/$PHONE_Bills_$bpath.zip && log "EMAIL sent....."
|
||||||
|
mpack -s "[G1sms+]_G1Billets ($bpath) imprimer recto/verso vos G1Billets?!" -d /tmp/message_body.txt ./Dos_G1Billets.odt $MAIL && log "+ EMAIL recto: OK"
|
||||||
|
log "G1Billets $PHONE_Bills_$bpath.pdf envoyé par email à $MEMBER : $MAIL "
|
||||||
mess="[G1SMS]
|
mess="[G1SMS]
|
||||||
$NBbillets billet(s) de $VALbillet $UNIT ($TRANSAC G1) créé(s).
|
$NBbillets G1Billets de $VALbillet $UNIT ($TRANSAC G1) créé(s).
|
||||||
Contactez $ADMINPSEUDO au $ADMINPHONE pour les recevoir...
|
Envoyés vers $MAIL, vérifiez vos SPAM...
|
||||||
http://g1sms.fr/g1sms/aide"
|
Support: $ADMINPSEUDO ($ADMINPHONE)
|
||||||
|
"
|
||||||
|
|
||||||
sms_SEND "$phone" "$mess"
|
sms_SEND "$phone" "$mess"
|
||||||
|
|
||||||
|
|
|
@ -41,24 +41,22 @@ https://www.g1sms.fr/contact"
|
||||||
# Account creation
|
# Account creation
|
||||||
sms_INIT_ACCOUNT "$PHONE"
|
sms_INIT_ACCOUNT "$PHONE"
|
||||||
fi
|
fi
|
||||||
log "./silkaj/silkaj transaction --auth-scrypt -salt=\"$CODE\" -password=\"$SEC $SALT\" --amount=\"$AMOUNTG1\" --output=\"$PUBKEY\" --comment=\"THIRD_PARTY_MANAGER:$MASTERPUB:G1SMS:ENCAISSEMENT:$CODE\" -y"
|
log "./silkaj/silkaj transaction --auth-scrypt -salt=\"$CODE\" -password=\"$SEC$SALT\" --amount=\"$AMOUNTG1\" --output=\"$PUBKEY\" --comment=\"THIRD_PARTY_MANAGER:$MASTERPUB:G1SMS:ENCAISSEMENT:$CODE\" -y"
|
||||||
PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$CODE" -password="$SEC $SALT" --amount="$AMOUNTG1" --output="$PUBKEY" --comment="THIRD_PARTY_MANAGER:$MASTERPUB:ENCAISSEMENT:$CODE" -y)
|
PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$CODE" -password="$SEC$SALT" --amount="$AMOUNTG1" --output="$PUBKEY" --comment="THIRD_PARTY_MANAGER:$MASTERPUB:ENCAISSEMENT:$CODE" -y)
|
||||||
|
|
||||||
if [[ "$(echo $PAY | cut -d '|' -f 1)" != "KO" ]]; then
|
if [[ "$(echo $PAY | cut -d '|' -f 1)" != "KO" ]]; then
|
||||||
# DESTROY BILLET
|
# DESTROY BILLET
|
||||||
rm -f ./billets/$bpath/note.*
|
rm -Rf ./billets/$bpath
|
||||||
rmdir ./billets/$bpath
|
|
||||||
# DESTROY PUBLIC CACHE in /tmp
|
# DESTROY PUBLIC CACHE in /tmp
|
||||||
if [ -d "/tmp/billets_valides/$bpath" ]; then
|
if [ -d "/tmp/billets_valides/$bpath" ]; then
|
||||||
rm -f /tmp/billets_valides/$bpath/*
|
rm -Rf /tmp/billets_valides/$bpath
|
||||||
rmdir /tmp/billets_valides/$bpath
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SOLDE=$(./silkaj/silkaj amount "$PUBKEY")
|
SOLDE=$(./silkaj/silkaj amount "$PUBKEY")
|
||||||
|
|
||||||
mess="[G1SMS]
|
mess="[G1SMS]
|
||||||
ENCAISSEMENT de $VALbillet $UNIT ($AMOUNTG1 G1)
|
ENCAISSEMENT de $VALbillet $UNIT ($AMOUNTG1 G1)
|
||||||
ds le porte-monnaie $PHONE ($PUBKEY)
|
dans portefeuille $UIDNA ($PHONE)
|
||||||
OK!
|
OK!
|
||||||
Solde: $SOLDE G1"
|
Solde: $SOLDE G1"
|
||||||
sms_SEND "$PHONE" "$mess"
|
sms_SEND "$PHONE" "$mess"
|
||||||
|
@ -66,7 +64,7 @@ Solde: $SOLDE G1"
|
||||||
log "=> $PUBKEY"
|
log "=> $PUBKEY"
|
||||||
log_history $PHONE "BILLET_CHK, $AMOUNTG1, $bpath, $PUBKEY"
|
log_history $PHONE "BILLET_CHK, $AMOUNTG1, $bpath, $PUBKEY"
|
||||||
else
|
else
|
||||||
sms_ERROR "$PHONE" "Erreur! Transaction Impossible... Réessayez plus tard ou contactez $ADMINPSEUDO : $ADMINPHONE"
|
sms_ERROR "$PHONE" "Erreur! Transaction Impossible! Valeur du G1Billet $AMOUNTG1 G1. Contactez $ADMINPSEUDO : $ADMINPHONE"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
|
@ -17,10 +17,11 @@ NUMERO="$1"
|
||||||
SECRET="$2"
|
SECRET="$2"
|
||||||
MONTANT="$3"
|
MONTANT="$3"
|
||||||
UNIT="$4"
|
UNIT="$4"
|
||||||
DUFACTOR="$5"
|
JUNE="$5"
|
||||||
NOTERIB="$6"
|
NOTERIB="$6"
|
||||||
MEMBER="$7"
|
MEMBER="$7"
|
||||||
TRANSAC="$8"
|
TRANSAC="$8"
|
||||||
|
PHONE="$9"
|
||||||
log "X ./shell/sms_BILLET_MAKE.sh \"$1\" \"$2\" \"$3\" \"$4\" \"$5\" \"$6\" \"$7\" \"$8\""
|
log "X ./shell/sms_BILLET_MAKE.sh \"$1\" \"$2\" \"$3\" \"$4\" \"$5\" \"$6\" \"$7\" \"$8\""
|
||||||
|
|
||||||
if [[ "$NOTERIB" == "" || "$MEMBER" == "" ]]
|
if [[ "$NOTERIB" == "" || "$MEMBER" == "" ]]
|
||||||
|
@ -43,17 +44,21 @@ fi
|
||||||
valid="0${valid:0:2}"
|
valid="0${valid:0:2}"
|
||||||
# ADD VALIDITY to convert: -pointsize 20 -draw 'text 380,410 "'"A encaisser avant le 01/$valid/$year"'"' \
|
# ADD VALIDITY to convert: -pointsize 20 -draw 'text 380,410 "'"A encaisser avant le 01/$valid/$year"'"' \
|
||||||
|
|
||||||
# Add G1sms logo (250px)
|
# ADD Avatar on G1 Logo SouthEast
|
||||||
composite -compose Over -gravity SouthWest -geometry +50+50 "./shell/G1sms.png" "./shell/Oeuro.jpg" "/tmp/$NUMERO.jpg"
|
if [[ $(file "./wallets/$PHONE/$PHONE.avatar.png" | grep 'PNG') ]]; then
|
||||||
|
composite -compose Over -gravity East -geometry +15+0 -dissolve 33% "./wallets/$PHONE/$PHONE.avatar.png" "./shell/Oeuro.jpg" "/tmp/$NUMERO.jpg"
|
||||||
|
composite -compose Over -gravity West -geometry +15+0 -dissolve 33% "./wallets/$PHONE/$PHONE.avatar.png" "/tmp/$NUMERO.jpg" "/tmp/$NUMERO.jpg"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add G1Billet_LOVE.png logo (250px)
|
||||||
|
composite -compose Over -gravity SouthWest -geometry +50+50 -dissolve 70% "./shell/G1Billet_LOVE.png" "/tmp/$NUMERO.jpg" "/tmp/$NUMERO.jpg"
|
||||||
|
|
||||||
# Prepare BILLET qrcode verification URL
|
# Prepare BILLET qrcode verification URL
|
||||||
#qrencode "$NOTERIB" -o "/tmp/$NUMERO_NOTERIB.png"
|
qrencode -s 3 -o "/tmp/$NUMERO_NOTERIB.png" "$NOTERIB"
|
||||||
REQ=$(echo $NUMERO | sed 's/ /_/g')
|
|
||||||
qrencode "https://www.g1sms.fr/$ADMINPSEUDO/check.php?code=$REQ" -o "/tmp/$NUMERO_NOTERIB.png"
|
|
||||||
|
|
||||||
# BILL PUBKEY => Someone can Add amount to it !!!
|
# BILL PUBKEY means Someone can Add amount to it !!!
|
||||||
# Add verification QRCode
|
# Add verification QRCode
|
||||||
composite -compose Over -gravity NorthEast -geometry +40+40 "/tmp/$NUMERO_NOTERIB.png" "/tmp/$NUMERO.jpg" "/tmp/$NUMERO.jpg"
|
composite -compose Over -gravity NorthEast -geometry +50+25 "/tmp/$NUMERO_NOTERIB.png" "/tmp/$NUMERO.jpg" "/tmp/$NUMERO.jpg"
|
||||||
|
|
||||||
# Add June logo
|
# Add June logo
|
||||||
case "$MONTANT" in
|
case "$MONTANT" in
|
||||||
|
@ -82,7 +87,7 @@ case "$MONTANT" in
|
||||||
cp "./shell/g1.png" "/tmp/g1.png"
|
cp "./shell/g1.png" "/tmp/g1.png"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
composite -compose Over -gravity SouthEast -geometry +20+20 "/tmp/g1.png" "/tmp/$NUMERO.jpg" "/tmp/$NUMERO.jpg"
|
composite -compose Over -gravity SouthEast -geometry +20+20 -dissolve 90% "/tmp/g1.png" "/tmp/$NUMERO.jpg" "/tmp/$NUMERO.jpg"
|
||||||
|
|
||||||
DUPART=$(bc -l <<< "scale=2; $MONTANT / 100")
|
DUPART=$(bc -l <<< "scale=2; $MONTANT / 100")
|
||||||
# ADD 0 to <1 DUPART
|
# ADD 0 to <1 DUPART
|
||||||
|
@ -95,11 +100,11 @@ fi
|
||||||
convert -font 'Liberation-Sans' \
|
convert -font 'Liberation-Sans' \
|
||||||
-pointsize 120 -fill black -draw 'text 200,220 "'"$DUPART DU"'"' \
|
-pointsize 120 -fill black -draw 'text 200,220 "'"$DUPART DU"'"' \
|
||||||
-pointsize 45 -draw 'text 550,270 "'"$MONTANT $UNIT"'"' \
|
-pointsize 45 -draw 'text 550,270 "'"$MONTANT $UNIT"'"' \
|
||||||
-pointsize 35 -draw 'text 50,60 "'"[G1sms] 06 66 80 57 20"'"' \
|
-pointsize 35 -draw 'text 50,60 "'"$JUNE G1 [G1sms $MASTERPHONE]"'"' \
|
||||||
-pointsize 30 -draw 'text 60,100 "'"CHK $NUMERO"'"' \
|
-pointsize 30 -draw 'text 60,100 "'"CHK $NUMERO"'"' \
|
||||||
-pointsize 22 -fill black -draw 'text 520,340 "'"$SECRET"'"' \
|
-pointsize 22 -fill black -draw 'text 520,340 "'"$SECRET"'"' \
|
||||||
-pointsize 22 -fill black -draw 'text 400,410 "'"Encaisser avant le 01/$valid/$year"'"' \
|
-pointsize 22 -fill black -draw 'text 400,410 "'"A encaisser avant le 01/$valid/$year"'"' \
|
||||||
-pointsize 20 -draw 'text 50,444 "'"Envoyer par sms, CHK $NUMERO + les mots découverts sous la zone à gratter"'"' \
|
-pointsize 20 -draw 'text 50,444 "'"SMS: CHK $NUMERO + mots secrets à gratter ou https://cesium.app "'"' \
|
||||||
"/tmp/$NUMERO.jpg" "/tmp/BILL.$year.$valid.$NUMERO.$MONTANT.$UNIT.jpg"
|
"/tmp/$NUMERO.jpg" "/tmp/BILL.$year.$valid.$NUMERO.$MONTANT.$UNIT.jpg"
|
||||||
|
|
||||||
# Payable par SMS en envoyant les codes grattant la case comportant le SECRET
|
# Payable par SMS en envoyant les codes grattant la case comportant le SECRET
|
||||||
|
|
|
@ -36,7 +36,7 @@ fi
|
||||||
|
|
||||||
# SEND EMAIL WITH ssmtp
|
# SEND EMAIL WITH ssmtp
|
||||||
SUBJECT="[G1sms+] $MEMBER, message de votre portefeuille monnaie libre $UIDNA ($PHONE)"
|
SUBJECT="[G1sms+] $MEMBER, message de votre portefeuille monnaie libre $UIDNA ($PHONE)"
|
||||||
MESSAGE="Bonjour $MEMBER\n\nLe detenteur du porte-monnaie G1sms $UIDNA ($PHONE) a choisi votre email comme contact.\nVous y recevrez nos prochains envois ...\n\n\nA bientot <3\n$ADMINPSEUDO - ($MASTERPHONE) Partenaire G1sms+"
|
MESSAGE="Bonjour $MEMBER\n\nVotre porte-monnaie G1sms $UIDNA ($PHONE) a choisi votre email comme contact.\nPour commander vos G1Billets, envoyez par SMS à $MASTERPHONE :\nBILL 10/20/50/100/200/500/1000\n\n\nA bientot <3\n$ADMINPSEUDO - ($MASTERPHONE) Partenaire G1sms+"
|
||||||
cat ./email.txt | sed s/EMAIL/"${mail}"/g | sed s/SUBJECT/"${SUBJECT}"/g | sed s/MESSAGE/"${MESSAGE}"/g | ssmtp ${mail}
|
cat ./email.txt | sed s/EMAIL/"${mail}"/g | sed s/SUBJECT/"${SUBJECT}"/g | sed s/MESSAGE/"${MESSAGE}"/g | ssmtp ${mail}
|
||||||
log "__SUB:sms_EMAIL.sh.sh: Send welcome EMAIL to $mail via ssmtp"
|
log "__SUB:sms_EMAIL.sh.sh: Send welcome EMAIL to $mail via ssmtp"
|
||||||
log_history $PHONE "EMAIL, $mail"
|
log_history $PHONE "EMAIL, $mail"
|
||||||
|
@ -44,7 +44,7 @@ log_history $PHONE "EMAIL, $mail"
|
||||||
mess="[G1sms+]
|
mess="[G1sms+]
|
||||||
$MEMBER
|
$MEMBER
|
||||||
Votre email est : $mail
|
Votre email est : $mail
|
||||||
Mettez le à jour, quand cela est nécessaire..."
|
Mettez le à jour, si cela est nécessaire..."
|
||||||
|
|
||||||
sms_SEND "$phone" "$mess"
|
sms_SEND "$phone" "$mess"
|
||||||
|
|
||||||
|
|
|
@ -57,10 +57,10 @@ cat /dev/ttyACM0 | while read line; do
|
||||||
FID=$(echo $ID | awk '{print toupper($1)}')
|
FID=$(echo $ID | awk '{print toupper($1)}')
|
||||||
RR=$(echo $ID | sed s/\ //g)
|
RR=$(echo $ID | sed s/\ //g)
|
||||||
|
|
||||||
./shell/tools/4LETTER.scroll.py "G1TAG $FID >"
|
./shell/tools/4LETTER.scroll.py "${#act[@]} $FID > "
|
||||||
RVALUE=$(su $YOU -c "ipfs cat /ipns/$J/TAG_amount");
|
RVALUE=$(su $YOU -c "ipfs cat /ipns/$J/TAG_amount");
|
||||||
CURRENCY=$(su $YOU -c "ipfs cat /ipns/$J/TAG_currency" | awk '{print tolower($1)}')
|
CURRENCY=$(su $YOU -c "ipfs cat /ipns/$J/TAG_currency" | awk '{print tolower($1)}')
|
||||||
if [[ "$CURRENCY" == "zen" ]]; then CUR="zène"; else CUR=$CURRENCY; fi # Correction du défaut de prononciation.
|
|
||||||
PASSENGER=$(su $YOU -c "ipfs cat /ipns/$J/TAG_passenger");
|
PASSENGER=$(su $YOU -c "ipfs cat /ipns/$J/TAG_passenger");
|
||||||
if [[ "$PASSENGER" != "" ]]; then
|
if [[ "$PASSENGER" != "" ]]; then
|
||||||
./shell/tools/4LETTER.scroll.py "G1TAG PASSENGER $RVALUE ZEN"
|
./shell/tools/4LETTER.scroll.py "G1TAG PASSENGER $RVALUE ZEN"
|
||||||
|
@ -87,10 +87,10 @@ cat /dev/ttyACM0 | while read line; do
|
||||||
FID=$(echo $ID | awk '{print toupper($1)}')
|
FID=$(echo $ID | awk '{print toupper($1)}')
|
||||||
RR=$(echo $ID | sed s/\ //g)
|
RR=$(echo $ID | sed s/\ //g)
|
||||||
|
|
||||||
./shell/tools/4LETTER.scroll.py "G1TAG [TX] $FID >"
|
./shell/tools/4LETTER.scroll.py "${#act[@]} $FID TX >>"
|
||||||
BVALUE=$(su $YOU -c "ipfs cat /ipns/$J/TAG_amount")
|
BVALUE=$(su $YOU -c "ipfs cat /ipns/$J/TAG_amount")
|
||||||
CURRENCY=$(su $YOU -c "ipfs cat /ipns/$J/TAG_currency" | awk '{print tolower($1)}')
|
CURRENCY=$(su $YOU -c "ipfs cat /ipns/$J/TAG_currency" | awk '{print tolower($1)}')
|
||||||
if [[ "$CURRENCY" == "zen" ]]; then CUR="zène"; else CUR=$CURRENCY; fi # Correction du défaut de prononciation.
|
|
||||||
PASSENGER=$(su $YOU -c "ipfs cat /ipns/$J/TAG_passenger");
|
PASSENGER=$(su $YOU -c "ipfs cat /ipns/$J/TAG_passenger");
|
||||||
# DIG PUBLISHING KEY
|
# DIG PUBLISHING KEY
|
||||||
if [[ -f /home/$YOU/.ipfs/keystore/$RR ]]; then
|
if [[ -f /home/$YOU/.ipfs/keystore/$RR ]]; then
|
||||||
|
@ -122,7 +122,7 @@ cat /dev/ttyACM0 | while read line; do
|
||||||
|
|
||||||
*)
|
*)
|
||||||
if [[ $lon -eq 44 ]]; then
|
if [[ $lon -eq 44 ]]; then
|
||||||
./shell/tools/4LETTER.scroll.py "PORTEFEUILLE G1 >>>>>>>>" &
|
./shell/tools/4LETTER.scroll.py "PORTEFEUILLE G1 >>>>>>>> ${#act[@]}" &
|
||||||
J=$qrvalue
|
J=$qrvalue
|
||||||
if [[ "$J" != "${obj[0]}" ]]; then
|
if [[ "$J" != "${obj[0]}" ]]; then
|
||||||
VALUE=$(./shell/timeout.sh -t 25 ./silkaj/silkaj amount $J)
|
VALUE=$(./shell/timeout.sh -t 25 ./silkaj/silkaj amount $J)
|
||||||
|
|
|
@ -34,7 +34,7 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
[[ -f /var/www/kalkun/scripts/daemon.sh ]] && /var/www/kalkun/scripts/daemon.sh
|
[[ -f /var/www/kalkun/scripts/daemon.sh ]] && /var/www/kalkun/scripts/daemon.sh
|
||||||
|
|
||||||
export YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1)
|
export YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1)
|
||||||
cd $GPATH
|
cd $MY_PATH
|
||||||
source $MY_PATH/shell/init.sh
|
source $MY_PATH/shell/init.sh
|
||||||
source $MY_PATH/shell/functions.sh
|
source $MY_PATH/shell/functions.sh
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ if [[ ! -f "./wallets/$PHONE/MASTERPHONE.sms" && "$CMD" != "ADMIN" ]]
|
||||||
then
|
then
|
||||||
NODEPHONE=$(cat "./wallets_swarm/$PHONE/MASTERPHONE.sms")
|
NODEPHONE=$(cat "./wallets_swarm/$PHONE/MASTERPHONE.sms")
|
||||||
if [[ "$NODEPHONE" != "$MASTERPHONE" && "$NODEPHONE" != "" ]]; then
|
if [[ "$NODEPHONE" != "$MASTERPHONE" && "$NODEPHONE" != "" ]]; then
|
||||||
sms_SEND "$PHONE" "[G1sms+] Vous avez déjà un compte portefeuille sur $NODEPHONE (Envoyez lui DESTROY avant de pouvoir "
|
sms_SEND "$PHONE" "[G1sms+] Vous avez déjà un compte portefeuille sur $NODEPHONE (Envoyez lui RAZ si vous voulez fermer votre compte)"
|
||||||
log "ALERT!! $PHONE compte existant sur le NODE G1sms+ ($NODEPHONE)"
|
log "ALERT!! $PHONE compte existant sur le NODE G1sms+ ($NODEPHONE)"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue