REC VIR AIDE
This commit is contained in:
parent
35f94120ce
commit
69f81ca221
2
_chain
2
_chain
|
@ -1 +1 @@
|
||||||
QmbRvGMpwZws4ii5xe5x8EgK1SSxNBaNNjinwdWjhye3TR
|
QmaN3w2NGxejb8yNN1sP4fvnfDV3YDghStcjbyLr7zchCC
|
||||||
|
|
|
@ -175,3 +175,4 @@ OK
|
||||||
2019-12-17: Better G1Tx
|
2019-12-17: Better G1Tx
|
||||||
2019-12-17: G1TAG REFRESH & more
|
2019-12-17: G1TAG REFRESH & more
|
||||||
2019-12-18: RAZ
|
2019-12-18: RAZ
|
||||||
|
2019-12-20: NOW
|
||||||
|
|
BIN
_publishkey.gpg
BIN
_publishkey.gpg
Binary file not shown.
|
@ -8,27 +8,38 @@
|
||||||
# IL CONSTITUE LE BATEMENT DE COEUR DU SYSTEME
|
# IL CONSTITUE LE BATEMENT DE COEUR DU SYSTEME
|
||||||
################################################################################
|
################################################################################
|
||||||
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)
|
||||||
|
if [[ "$USER" != "root" ]]; then echo "Hey, $USER you must at least be admin of your system (sudo $0)"; exit; fi
|
||||||
|
if [[ "$YOU" == "" || "$YOU" == "root" ]]; then echo "BAD IPFS. Aucune installation IPFS satisfaisante ici... Ciao $YOU !"; exit; fi
|
||||||
IPFSNODEID=$(su $YOU -c "ipfs id -f='<id>\n'")
|
IPFSNODEID=$(su $YOU -c "ipfs id -f='<id>\n'")
|
||||||
CHEMIN="/home/$YOU/G1sms+"
|
CHEMIN="/home/$YOU/G1sms+"
|
||||||
cd $CHEMIN
|
cd $CHEMIN
|
||||||
|
|
||||||
source ./shell/init.sh
|
source ./shell/init.sh
|
||||||
source ./shell/functions.sh
|
source ./shell/functions.sh
|
||||||
|
|
||||||
timebar=$(date +%H%M)
|
timebar=$(date +%H:%M)
|
||||||
|
|
||||||
if [[ "$USER" != "root" ]]; then echo "Hey, $USER you must at least be admin of your system. sudo -s ?"; exit; fi
|
##################################################################
|
||||||
if [[ "$YOU" == "" || "$YOU" == "root" ]]; then echo "BAD IPFS. Aucune installation IPFS satisfaisante ici... Ciao $YOU !"; exit; fi
|
if [[ "$1" == "" ]]; then
|
||||||
|
##################################################################
|
||||||
|
echo "It is $timebar in the morning, or in the night? It depends on your day..."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
##################################################################
|
||||||
|
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
# Refresh All peers SWARM Wallets.
|
if [[ "$1" == "PRINT" ]]; then
|
||||||
##################################################################
|
##################################################################
|
||||||
ipfs_swarm_wallets_refresh "SIMPLE"
|
##################################################################
|
||||||
|
# Refresh All peers SWARM Wallets.
|
||||||
|
##################################################################
|
||||||
|
ipfs_swarm_wallets_refresh "SIMPLE"
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# PRINT G1Tag PRINTED FROM ANOTHER NODE
|
# PRINT G1Tag PRINTED FROM ANOTHER NODE
|
||||||
# CREATE and REMOVE rr.bin -> done.rr
|
# CREATE and REMOVE rr.bin -> done.rr
|
||||||
if [[ -d "./wallets_swarm/.$IPFSNODEID/PRINT/" ]]; then
|
if [[ -d "./wallets_swarm/.$IPFSNODEID/PRINT/" ]]; then
|
||||||
log "__SUB:cron_MINUTE.sh: SEARCH NEW PRINT FOR ME .$IPFSNODEID"
|
log "__SUB:cron_MINUTE.sh: SEARCH NEW PRINT FOR ME .$IPFSNODEID"
|
||||||
mkdir -p ./wallets/.$IPFSNODEID/PRINT/
|
mkdir -p ./wallets/.$IPFSNODEID/PRINT/
|
||||||
|
|
||||||
|
@ -67,14 +78,19 @@ if [[ -d "./wallets_swarm/.$IPFSNODEID/PRINT/" ]]; then
|
||||||
|
|
||||||
rm "/tmp/G1Tag.bin"
|
rm "/tmp/G1Tag.bin"
|
||||||
rm "/tmp/G1Tag.png"
|
rm "/tmp/G1Tag.png"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##################################################################
|
|
||||||
if [[ "$timebar" == "0300" ]]; then
|
|
||||||
##################################################################
|
|
||||||
echo "It is 3 in the morning, or in the night? It depends on your day..."
|
|
||||||
fi
|
fi
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
|
##################################################################
|
||||||
|
if [[ "$1" == "KALKUN" ]]; then
|
||||||
|
##################################################################
|
||||||
|
for number in ./wallets/*; do
|
||||||
|
member=""
|
||||||
|
phone=$(echo $number | cut -d '/' -f 3);
|
||||||
|
if [[ -f $number/$phone.uidname ]]; then member=$(cat $number/$phone.uidname); fi
|
||||||
|
if [[ ! $member ]]; then member=$phone; fi
|
||||||
|
if [[ $phone && $member ]]; then add_contact $phone $member; log "__SUB:cron_MINUTE.sh: KALKUN add_contact $phone $member"; fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
##################################################################
|
||||||
|
|
|
@ -36,15 +36,21 @@ for result in $(find billets/ -daystart -mtime +$vieux -type d -name "*"); do
|
||||||
echo $secret $salt
|
echo $secret $salt
|
||||||
echo "/usr/local/bin/silkaj tx --amount=\"$virement\" --output=\"$dest\""
|
echo "/usr/local/bin/silkaj tx --amount=\"$virement\" --output=\"$dest\""
|
||||||
|
|
||||||
PAY=$(/usr/local/bin/silkaj -p duniter-g1.p2p.legal:443 tx --amount="$virement" --output="$dest" -y)
|
if [[ "$virement" == "0.0" ]]; then
|
||||||
|
echo "G1Billet déjà vide, suppression de $result"; rm -Rf $result;
|
||||||
if [[ ! $(echo $PAY | grep "successfully sent") ]]; then
|
|
||||||
echo "!!!! ERREUR: $virement Something Wrong happened with $result"
|
|
||||||
if [[ ! $virement ]]; then mv $result /tmp/$result; fi
|
|
||||||
else
|
else
|
||||||
echo "Tout s'est bien passé! On supprime $result et continue avec le billet $Nbillets"
|
PAY=$(/usr/local/bin/silkaj -p duniter-g1.p2p.legal:443 tx --amount="$virement" --output="$dest" -y)
|
||||||
|
if [[ ! $(echo $PAY | grep "successfully sent") ]]; then
|
||||||
|
echo "!!!! ERREUR: $virement Something Wrong happened with $result. Moving to /tmp/$billetname"
|
||||||
|
mkdir -p /tmp/$billetname
|
||||||
|
mv $result /tmp/$billetname
|
||||||
|
else
|
||||||
|
echo $PAY
|
||||||
|
echo "OK! On supprime $result et continue avec le billet $Nbillets"
|
||||||
|
echo
|
||||||
rm -Rf $result
|
rm -Rf $result
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "MEMBER:" $result
|
echo "MEMBER:" $result
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -11,21 +11,20 @@ log "X sms_AIDE.sh ($1=phone)"
|
||||||
sms_INIT_ACCOUNT "$1" "NOSMS"
|
sms_INIT_ACCOUNT "$1" "NOSMS"
|
||||||
|
|
||||||
MESS="[Aide]
|
MESS="[Aide]
|
||||||
N Id-M (Relier au portefeuille Id-M)
|
N Pseudo (membre ou nom de portefeuille) : Création portefeuille
|
||||||
U G1/DU/LOVE (UNIT)
|
U G1/DU/LOVE : Unité
|
||||||
S (Solde)
|
S : Solde
|
||||||
P 06nnnnnnnn 300 (Envoyer 300 UNIT à 06nnnnnnnn)"
|
P 06nnnnnnnn 300 : Payer 300 à 06nnnnnnnn"
|
||||||
# Send response SMS
|
# Send response SMS
|
||||||
sms_SEND "$1" "$MESS"
|
sms_SEND "$1" "$MESS"
|
||||||
|
|
||||||
MESS="EMAIL moi@email.tld (Recevoir vos commandes par email)
|
MESS="EMAIL moi@email.tld : Commander G1billets
|
||||||
TAG 10 5 (Créer 5 G1Tag de 10 G1)
|
VIR 50 Pseudo : Virer 50 à Pseudo (membre ou portefeuille)"
|
||||||
VIR 50 Idw (Virer 50 UNIT vers Idw)"
|
|
||||||
sms_SEND "$1" "$MESS"
|
sms_SEND "$1" "$MESS"
|
||||||
|
|
||||||
MESS="REC (Pour un payement récurrent)
|
MESS="REC 50 Dest S 4: Virer 50 à Dest pendant 4 Semaines (J/S/M/A)
|
||||||
D (Détail de votre compte)
|
RAZ : clôturer compte (vidé vers Pseudo)
|
||||||
A votre service.
|
OU Dab3241 : Imprimante ses G1Tag sur Dab3241
|
||||||
$ADMINPSEUDO / G1sms+ / $ADMINPHONE
|
$ADMINPSEUDO / G1sms+ / $ADMINPHONE
|
||||||
https://g1sms.fr"
|
https://g1sms.fr"
|
||||||
sms_SEND "$1" "$MESS"
|
sms_SEND "$1" "$MESS"
|
||||||
|
|
|
@ -79,20 +79,22 @@ else
|
||||||
log "__SUB:sms_REC.sh: SEARCH $VIRDEST related wallet!!! $DESTRIB "
|
log "__SUB:sms_REC.sh: SEARCH $VIRDEST related wallet!!! $DESTRIB "
|
||||||
DESTMEM="$VIRDEST"
|
DESTMEM="$VIRDEST"
|
||||||
# SEARCH IN WALLETS
|
# SEARCH IN WALLETS
|
||||||
LOCAL=$(grep -Rwl "$DESTMEM" ./wallets/*/*.uidna | tail -n 1 | cut -f 3 -d '/')
|
LOCAL=$(grep -Rwl "$DESTMEM" ./wallets/*/*.uidname | tail -n 1 | cut -f 3 -d '/')
|
||||||
|
if [[ "$LOCAL" == "" ]]; then LOCAL=$(grep -Rwl "$DESTMEM" ./wallets/*/*.uidna | tail -n 1 | cut -f 3 -d '/'); fi
|
||||||
if [[ "$LOCAL" != "" ]]; then
|
if [[ "$LOCAL" != "" ]]; then
|
||||||
# LOCAL G1sms account
|
# LOCAL G1sms account
|
||||||
DESTRIB=$(cat ./wallets/$LOCAL/$LOCAL.pub)
|
DESTRIB=$(cat ./wallets/$LOCAL/$LOCAL.pub)
|
||||||
DESTPHONE=$LOCAL
|
DESTPHONE=$LOCAL
|
||||||
log "__SUB:sms_REC.sh: FOUND LOCAL ($MASTERPHONE) G1sms+ wallet: $DESTRIB ($LOCAL)"
|
log "__SUB:sms_REC.sh: FOUND LOCAL ($MASTERPHONE) G1sms+ wallet: $DESTRIB ($LOCAL)"
|
||||||
else
|
else
|
||||||
# SEARCH IN WALLETS SWARM
|
# SEARCH IN WALLETS SWARM (MEMBER THEN UIDNA)
|
||||||
SWARMNB=$(grep -Rwl "$DESTMEM" ./wallets_swarm/*/*.uidna | tail -n 1 | cut -f 3 -d '/')
|
INSWARM=$(grep -Rwl "$DESTMEM" ./wallets_swarm/*/*.uidname | tail -n 1 | cut -f 3 -d '/')
|
||||||
if [[ "$LOCAL" != "" ]]; then
|
if [[ "$INSWARM" == "" ]]; then INSWARM=$(grep -Rwl "$DESTMEM" ./wallets_swarm/*/*.uidna | tail -n 1 | cut -f 3 -d '/'); fi
|
||||||
REMOTENODE=$(cat ./wallets_swarm/$SWARMNB/MASTERPHONE.sms)
|
if [[ "$INSWARM" != "" ]]; then
|
||||||
DESTRIB=$(cat ./wallets_swarm/$SWARMNB/$SWARMNB.pub)
|
REMOTENODE=$(cat ./wallets_swarm/$INSWARM/MASTERPHONE.sms)
|
||||||
DESTPHONE=$SWARMNB
|
DESTRIB=$(cat ./wallets_swarm/$INSWARM/$INSWARM.pub)
|
||||||
log "__SUB:sms_REC.sh: FOUND SWARM ($REMOTENODE) G1sms+ wallet: $DESTRIB ($SWARMNB)"
|
DESTPHONE=$INSWARM
|
||||||
|
log "__SUB:sms_REC.sh: FOUND SWARM ($REMOTENODE) G1sms+ wallet: $DESTRIB ($INSWARM)"
|
||||||
else
|
else
|
||||||
# SEARCH WITH SILKAJ
|
# SEARCH WITH SILKAJ
|
||||||
DESTRIB=$(./silkaj/silkaj id "$DESTMEM" | grep -w "$DESTMEM" | awk '{print $2}')
|
DESTRIB=$(./silkaj/silkaj id "$DESTMEM" | grep -w "$DESTMEM" | awk '{print $2}')
|
||||||
|
|
|
@ -48,15 +48,17 @@ else
|
||||||
log "__SUB:sms_VIR.sh: SEARCH $VIRDEST related wallet!!! $DESTRIB "
|
log "__SUB:sms_VIR.sh: SEARCH $VIRDEST related wallet!!! $DESTRIB "
|
||||||
DESTMEM="$VIRDEST"
|
DESTMEM="$VIRDEST"
|
||||||
# SEARCH IN WALLETS
|
# SEARCH IN WALLETS
|
||||||
LOCAL=$(grep -Rwl "$DESTMEM" ./wallets/*/*.uidna | tail -n 1 | cut -f 3 -d '/')
|
LOCAL=$(grep -Rwl "$DESTMEM" ./wallets/*/*.uidname | tail -n 1 | cut -f 3 -d '/')
|
||||||
|
if [[ "$LOCAL" == "" ]]; then LOCAL=$(grep -Rwl "$DESTMEM" ./wallets/*/*.uidna | tail -n 1 | cut -f 3 -d '/'); fi
|
||||||
if [[ "$LOCAL" != "" ]]; then
|
if [[ "$LOCAL" != "" ]]; then
|
||||||
# LOCAL G1sms account
|
# LOCAL G1sms account
|
||||||
DESTRIB=$(cat ./wallets/$LOCAL/$LOCAL.pub)
|
DESTRIB=$(cat ./wallets/$LOCAL/$LOCAL.pub)
|
||||||
DESTPHONE=$LOCAL
|
DESTPHONE=$LOCAL
|
||||||
log "__SUB:sms_VIR.sh: FOUND LOCAL ($MASTERPHONE) G1sms+ wallet: $DESTRIB ($LOCAL)"
|
log "__SUB:sms_VIR.sh: FOUND LOCAL ($MASTERPHONE) G1sms+ wallet: $DESTRIB ($LOCAL)"
|
||||||
else
|
else
|
||||||
# SEARCH IN WALLETS SWARM
|
# SEARCH IN WALLETS SWARM (MEMBER THEN UIDNA)
|
||||||
INSWARM=$(grep -Rwl "$DESTMEM" ./wallets_swarm/*/*.uidna | tail -n 1 | cut -f 3 -d '/')
|
INSWARM=$(grep -Rwl "$DESTMEM" ./wallets_swarm/*/*.uidname | tail -n 1 | cut -f 3 -d '/')
|
||||||
|
if [[ "$INSWARM" == "" ]]; then INSWARM=$(grep -Rwl "$DESTMEM" ./wallets_swarm/*/*.uidna | tail -n 1 | cut -f 3 -d '/'); fi
|
||||||
if [[ "$INSWARM" != "" ]]; then
|
if [[ "$INSWARM" != "" ]]; then
|
||||||
REMOTENODE=$(cat ./wallets_swarm/$INSWARM/MASTERPHONE.sms)
|
REMOTENODE=$(cat ./wallets_swarm/$INSWARM/MASTERPHONE.sms)
|
||||||
DESTRIB=$(cat ./wallets_swarm/$INSWARM/$INSWARM.pub)
|
DESTRIB=$(cat ./wallets_swarm/$INSWARM/$INSWARM.pub)
|
||||||
|
|
Loading…
Reference in New Issue