shell/sms_ABO.sh

This commit is contained in:
qo-op 2019-12-18 02:31:12 +01:00
parent bd5efb3a67
commit f07f5f994a
8 changed files with 28 additions and 12 deletions

2
_chain
View File

@ -1 +1 @@
QmTDcHP1Nqy4SFzYCwuDH3JxvBT7fsdAKWQvrcvsVPMUpD
QmbRvGMpwZws4ii5xe5x8EgK1SSxNBaNNjinwdWjhye3TR

View File

@ -174,3 +174,4 @@ OK
2019-12-14:
2019-12-17: Better G1Tx
2019-12-17: G1TAG REFRESH & more
2019-12-18: RAZ

View File

@ -1 +1 @@
1576604811163661452
1576627244479575204

Binary file not shown.

View File

@ -67,7 +67,7 @@ for tag in ./wallets/.$IPFSNODEID/TAG/*; do
rm /home/$YOU/.ipfs/keystore/${RR}.crypt
fi
echo "__SUB:cron_G1TAG_REFRESH.sh: G1Tag PUBLISHKEY OK : /home/$YOU/.ipfs/keystore/${RR}"
echo ${NANODATE} > ./TAG/${RR}/TAG_nanodate
# PUBLISH VERIFIED G1Tag VERSION
I=$(su $YOU -c "ipfs add -qr ./TAG/${RR} | tail -n 1")
# RECORD TAG_chain And HASH again

View File

@ -116,8 +116,8 @@ if [[ $PHONE ]]; then rm -Rf ./wallets_swarm/$PHONE; fi
su $YOU -c "ipfs get --output=./wallets_swarm/ /ipns/$IPFSNODEID"
count=1
# Search for All peers Nodes. TODO: To be changed when Swarm is too bug or not expendanding
#for id in ./wallets_swarm/.Qm*/;
for id in $(su $YOU -c "ipfs swarm peers" | awk -F '/' '{print $7}');
for id in ./wallets_swarm/.Qm*/;
#for id in $(su $YOU -c "ipfs swarm peers" | awk -F '/' '{print $7}');
do
count=$((count+1))
id=$(echo $id | cut -d '.' -f 3 | cut -d '/' -f 1)

24
shell/sms_ABO.sh Normal file → Executable file
View File

@ -11,12 +11,28 @@
# TODO: Create information Channels and moderate OPT IN/OUT
source ./shell/init.sh
source ./shell/functions.sh
log "__SUB:sms_ABO.sh: START ($1=SERVICE, $2=YESNO)"
SERVICE=$1
YESNO=$2
PARAMS=$3
log "__SUB:sms_ABO.sh: START ($1=PHONE, $2=SERVICE)"
PHONE=$1
SERVICE=$2
sms_INIT_ACCOUNT "$PHONE"
case "$SERVICE" in
ON)
log "Abonnement Kalkun"
if [[ "$MEMBER" != "" ]]; then
add_contact $MEMBER $PHONE && log "${c_green}Contact has been added to database$c_" || "${c_red}Contact can't be added to database$c_";
sms_SEND "$PHONE" "$MEMBER votre inscription annuaire est active"
fi
;;
OFF)
log "Retrait Kalkun"
if [[ $MEMBER ]]; then
rm_contact $MEMBER $PHONE && log "${c_green}Contact has been deleted from database$c_" || "${c_red}Contact can't be deleted database$c_";
sms_SEND "$PHONE" "$MEMBER retrait annuaire prise en compte..."
fi
;;
MARCHE)
log "Avertissement G1 marchés"
# PARAMS could be "$distance" to Member GeoPoint...

View File

@ -184,9 +184,8 @@ case "$CMD" in
;;
ABO)
# GERER SES ABONNEMENT CANAUX INFO SMS
CANAL=$(echo "$TEXT" | awk '{print $2}'| grep -E "([A-Za-z0-9\-\_]+$)")
YESNO=$(echo "$TEXT" | awk '{print $3}'| grep -E "([A-Za-z0-9\-\_]+$)")
./shell/sms_ABO.sh "$PHONE" "$CANAL" "$YESNO" &
SERVICE=$(echo "$TEXT" | awk '{print toupper($2)}'| grep -E "([A-Za-z0-9\-\_]+$)")
./shell/sms_ABO.sh "$PHONE" "$SERVICE" &
;;
DELIVERED|PENDING|FAILED)
# If delivered/pending notification come back (gammu/phone config)