Add kalkun script exectution if exist iin sms_received.sh
This commit is contained in:
parent
ad7c7348da
commit
08b628a8a9
|
@ -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é.
|
# 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 ;)
|
# Puis se mettent à jour autour des $ADMINPHONE par consensus d'utilisateurs ;)
|
||||||
#
|
#
|
||||||
# Log => tail -f /tmp/g1sms.log -n 200
|
# Log => tail -f /tmp/g1sms.log -n 200
|
||||||
# gammu => tail -f /tmp/smsd.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.
|
# 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
|
# 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.
|
# 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...
|
# ELLE EST PROVISION EN CAS DE FRAUDE ET SA REATRIBUTION POURRA EVOLUER...
|
||||||
#
|
#
|
||||||
# Author: Fred (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)
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
# 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 YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1)
|
||||||
export CHEMIN="/home/$YOU/G1sms+"
|
export CHEMIN="/home/$YOU/G1sms+"
|
||||||
cd $CHEMIN
|
cd $CHEMIN
|
||||||
|
@ -55,7 +59,7 @@ log "#############################################"
|
||||||
security
|
security
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
# Refresh All peers SWARM Wallets.
|
# Refresh All peers SWARM Wallets.
|
||||||
##################################################################
|
##################################################################
|
||||||
ipfs_swarm_wallets_refresh
|
ipfs_swarm_wallets_refresh
|
||||||
|
|
||||||
|
@ -109,9 +113,9 @@ case "$CMD" in
|
||||||
else
|
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)" &
|
./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
|
fi
|
||||||
;;
|
;;
|
||||||
REC)
|
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]+$")
|
AMOUNT=$(echo "$TEXT" | awk '{print $2}' | grep -E "^\-?[0-9]+$")
|
||||||
VIRDEST=$(echo "$TEXT" | awk '{print $3}' | grep -E "([A-Za-z0-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\-\_]+$)")
|
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
|
if [[ "$VIRDEST" != "" && "$AMOUNT" != "" && "$PERIOD" != "" && "$TIME" != "" ]]; then
|
||||||
./shell/sms_REC.sh "$PHONE" "$VIRDEST" "$AMOUNT" "$PERIOD" "$TIME" &
|
./shell/sms_REC.sh "$PHONE" "$VIRDEST" "$AMOUNT" "$PERIOD" "$TIME" &
|
||||||
else
|
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
|
fi
|
||||||
;;
|
;;
|
||||||
C|S|SOLDE)
|
C|S|SOLDE)
|
||||||
|
@ -165,7 +169,7 @@ case "$CMD" in
|
||||||
if [[ "$VAL" != "" ]]; then
|
if [[ "$VAL" != "" ]]; then
|
||||||
./shell/sms_G1TAG.sh "$PHONE" "$VAL" "$NUM" &
|
./shell/sms_G1TAG.sh "$PHONE" "$VAL" "$NUM" &
|
||||||
else
|
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
|
fi
|
||||||
;;
|
;;
|
||||||
U|UNIT)
|
U|UNIT)
|
||||||
|
@ -189,7 +193,7 @@ case "$CMD" in
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
ADMIN)
|
ADMIN)
|
||||||
# If Phone is ADMIN
|
# If Phone is ADMIN
|
||||||
if [[ "$PHONE" == "$ADMINPHONE" ]]; then
|
if [[ "$PHONE" == "$ADMINPHONE" ]]; then
|
||||||
CMD=$(echo "$TEXT" | awk '{print toupper($2)}')
|
CMD=$(echo "$TEXT" | awk '{print toupper($2)}')
|
||||||
PARAM=$(echo "$TEXT" | awk '{print substr($0,index($0,$3))}')
|
PARAM=$(echo "$TEXT" | awk '{print substr($0,index($0,$3))}')
|
||||||
|
|
Loading…
Reference in New Issue