multipass

This commit is contained in:
qo-op 2020-05-12 23:02:53 +02:00
parent 9bf088794a
commit 0b4c9a0169
4 changed files with 13 additions and 12 deletions

View File

@ -41,14 +41,15 @@ while read line
NB=${virement[7]}
sms_INIT_ACCOUNT "$PHONE" "NOSMS"
# echo -salt="$PHONE" -password="$PIN" --amount="$VIR" --output="$DESTRIB" --comment="[G1sms+] VIR $REF / $NB"
PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$VIR" --output="$DESTRIB" --comment="[G1sms+] VIR $REF / $NB" -y)
if [[ "$(echo $PAY | cut -d '|' -f 1)" == "KO" ]]; then
sms_ERROR "$PHONE" "Il est survenu un problème avec votre virement. Retour silkaj: $PAY ... $new";
duniter_server=$(./tools/duniter_getnode.sh)
PAY=$(silkaj -p "$duniter_server" -af --file /home/$YOU/.zen/g1sms_wallets/$PHONE/secret.dunikey tx --output "$DESTRIB" --amount "$VIR" --comment "[G1sms+] VIR $REF / $NB" -y)
if [[ "$(echo $PAY | grep 'successful')" == "" || "$PAY" == "" ]]; then
sms_ERROR "$PHONE" "Problème Virement. $PAY";
else
sms_SEND "$PHONE" "$TODAY Virement automatique $REF vers $DESTUID : $PAY (Reste $NB)"
sms_SEND "$PHONE" "$TODAY Virement automatique $REF vers $DESTUID (Reste $NB) : $PAY"
fi
log "__SUB:cron_VIR.reccurent.sh: $TODAY VIR DONE.... Rotation Silkaj : $new "
log "__SUB:cron_VIR.reccurent.sh: $TODAY VIR DONE...."
else
virement=""
echo "$(declare -p virement)"
@ -57,7 +58,7 @@ done < /tmp/VIR$TODAY
# CHECK FOR LAST VIREMENTS AND CLEAN IT?
for virfile in "/home/$YOU/.zen/g1sms_wallets/*/VIREMENTS.gpg"; do
phone=$(echo $virfile | cut -d '/' -f 3)
phone=$(echo $virfile | cut -d '/' -f 6)
if [[ "$phone" == "*" ]]; then exit; fi
echo "${IPFSPrivKey}" | gpg -d -q --output "/tmp/$phone.VIREMENTS" --yes --pinentry-mode loopback --passphrase-fd 0 "/home/$YOU/.zen/g1sms_wallets/$phone/VIREMENTS.gpg"
nv=0; tot=0;

View File

@ -13,7 +13,7 @@ PHONEDEST="$2"
# Initialise PHONE, PIN, PUBKEY, UNIT
sms_INIT_ACCOUNT "$phone" "NOSMS"
pin=$PIN
if [[ $UNKNOWN == "unknown" ]]; then
sms_ERROR "$phone" "Porte-monnaie inconnu. Envoyez N (suivi de votre Pseudo membre) pour le créer."
exit 1

View File

@ -90,8 +90,8 @@ else
##################### REWRITE TODO
# SEARCH IN WALLETS SWARM (MEMBER THEN UIDNA)
# INSWARM=$(grep -Rwl "$DESTMEM" /home/$YOU/.zen/g1sms_wallets_swarm/*/*.uidname | tail -n 1 | cut -f 3 -d '/')
# if [[ "$INSWARM" == "" ]]; then INSWARM=$(grep -Rwl "$DESTMEM" /home/$YOU/.zen/g1sms_wallets_swarm/*/*.uidna | tail -n 1 | cut -f 3 -d '/'); fi
# INSWARM=$(grep -Rwl "$DESTMEM" /home/$YOU/.zen/g1sms_wallets_swarm/*/*.uidname | tail -n 1 | cut -f 6 -d '/')
# if [[ "$INSWARM" == "" ]]; then INSWARM=$(grep -Rwl "$DESTMEM" /home/$YOU/.zen/g1sms_wallets_swarm/*/*.uidna | tail -n 1 | cut -f 6 -d '/'); fi
# if [[ "$INSWARM" != "" ]]; then
# REMOTENODE=$(cat /home/$YOU/.zen/g1sms_wallets_swarm/$INSWARM/MASTERPHONE.sms)
# DESTRIB=$(cat /home/$YOU/.zen/g1sms_wallets_swarm/$INSWARM/$INSWARM.pub)

View File

@ -59,8 +59,8 @@ else
##################### REWRITE TODO
# SEARCH IN WALLETS SWARM (MEMBER THEN UIDNA)
# INSWARM=$(grep -Rwl "$DESTMEM" /home/$YOU/.zen/g1sms_wallets_swarm/*/*.uidname | tail -n 1 | cut -f 3 -d '/')
# if [[ "$INSWARM" == "" ]]; then INSWARM=$(grep -Rwl "$DESTMEM" /home/$YOU/.zen/g1sms_wallets_swarm/*/*.uidna | tail -n 1 | cut -f 3 -d '/'); fi
# INSWARM=$(grep -Rwl "$DESTMEM" /home/$YOU/.zen/g1sms_wallets_swarm/*/*.uidname | tail -n 1 | cut -f 6 -d '/')
# if [[ "$INSWARM" == "" ]]; then INSWARM=$(grep -Rwl "$DESTMEM" /home/$YOU/.zen/g1sms_wallets_swarm/*/*.uidna | tail -n 1 | cut -f 6 -d '/'); fi
# if [[ "$INSWARM" != "" ]]; then
# REMOTENODE=$(cat /home/$YOU/.zen/g1sms_wallets_swarm/$INSWARM/MASTERPHONE.sms)
# DESTRIB=$(cat /home/$YOU/.zen/g1sms_wallets_swarm/$INSWARM/$INSWARM.pub)