Add kalkun script exectution if exist iin sms_received.sh

This commit is contained in:
poka 2019-12-15 23:27:06 +00:00
parent 9231e6718a
commit 8647b941d6
1 changed files with 13 additions and 9 deletions

View File

@ -6,7 +6,7 @@
#
# G1sms+ est totalement décentralisé! Il peut être fait de multiples SWARM de Services dont les codes évoluent de façon décentralisé.
# Puis se mettent à jour autour des $ADMINPHONE par consensus d'utilisateurs ;)
#
#
# Log => tail -f /tmp/g1sms.log -n 200
# gammu => tail -f /tmp/smsd.log -n 200
#
@ -16,16 +16,20 @@
#
# Utiliser la commande ./search fournie pour fouiller dans le code, mais tout est ordonnancé d'ici, donc vous êtes au bon endroit pour commencer à farfouiller.
###############################################################################
# EN FAISANT PARTIE DU SWARM G1sms+ VOUS VOUS ENGAGEZ A ASSURER LA SECURITE
# EN FAISANT PARTIE DU SWARM G1sms+ VOUS VOUS ENGAGEZ A ASSURER LA SECURITE
# PHYSIQUE ET INFORMATIQUE DE VOTRE NOEUD ET NE PAS INTRODUIRE DE CODE MALVEILLANT
# DANS LE GROUPE SI VOUS ETES AMENES A EN PROPOSER UNE MISE A JOUR.
# UNE COMMISSION EST PERCU SUR CERTAINS TRANSFERTS.
# UNE COMMISSION EST PERCU SUR CERTAINS TRANSFERTS.
# ELLE EST PROVISION EN CAS DE FRAUDE ET SA REATRIBUTION POURRA EVOLUER...
#
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: GPL (http://www.google.com/search?q=GPL)
################################################################################
# Execute Kalkun daemon
[[ -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 CHEMIN="/home/$YOU/G1sms+"
cd $CHEMIN
@ -55,7 +59,7 @@ log "#############################################"
security
##################################################################
# Refresh All peers SWARM Wallets.
# Refresh All peers SWARM Wallets.
##################################################################
ipfs_swarm_wallets_refresh
@ -109,9 +113,9 @@ case "$CMD" in
else
./shell/sms_ERROR.sh "$PHONE" "ex:: VIR 100 mot5678 = Envoyer 100 $UNIT au portefeuille G1sms+ 'mot5678' (On peut aussi utiliser le pseudo d'un Membre)" &
fi
;;
;;
REC)
# ex: "REC 2000 John J 12" (Virer 2000 UNIT au G1sms+ wallet de John pour les 12 prochains jours)
# ex: "REC 2000 John J 12" (Virer 2000 UNIT au G1sms+ wallet de John pour les 12 prochains jours)
AMOUNT=$(echo "$TEXT" | awk '{print $2}' | grep -E "^\-?[0-9]+$")
VIRDEST=$(echo "$TEXT" | awk '{print $3}' | grep -E "([A-Za-z0-9\-\_]+$)")
PERIOD=$(echo "$TEXT" | awk '{print toupper($4)}' | grep -E "([A-Za-z0-9\-\_]+$)")
@ -119,7 +123,7 @@ case "$CMD" in
if [[ "$VIRDEST" != "" && "$AMOUNT" != "" && "$PERIOD" != "" && "$TIME" != "" ]]; then
./shell/sms_REC.sh "$PHONE" "$VIRDEST" "$AMOUNT" "$PERIOD" "$TIME" &
else
./shell/sms_ERROR.sh "$PHONE" "ex:: REC 20 Fred M 12 => Virer 20 $UNIT au portefeuille G1sms+ de Fred pendant 12 Mois (Choisir la période: J,S,M,A)." &
./shell/sms_ERROR.sh "$PHONE" "ex:: REC 20 Fred M 12 => Virer 20 $UNIT au portefeuille G1sms+ de Fred pendant 12 Mois (Choisir la période: J,S,M,A)." &
fi
;;
C|S|SOLDE)
@ -165,7 +169,7 @@ case "$CMD" in
if [[ "$VAL" != "" ]]; then
./shell/sms_G1TAG.sh "$PHONE" "$VAL" "$NUM" &
else
./shell/sms_ERROR.sh "$PHONE" "ex:: TAG 2 12 => Créer 12 G1Tag de 2 G1" &
./shell/sms_ERROR.sh "$PHONE" "ex:: TAG 2 12 => Créer 12 G1Tag de 2 G1" &
fi
;;
U|UNIT)
@ -189,7 +193,7 @@ case "$CMD" in
exit
;;
ADMIN)
# If Phone is ADMIN
# If Phone is ADMIN
if [[ "$PHONE" == "$ADMINPHONE" ]]; then
CMD=$(echo "$TEXT" | awk '{print toupper($2)}')
PARAM=$(echo "$TEXT" | awk '{print substr($0,index($0,$3))}')