Commit 2b4ce17b authored by Fred's avatar Fred

Delete sms_COUNT.sh~

parent f1ee956f
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: GPL (http://www.google.com/search?q=GPL)
################################################################################
source /root/G1SMS/shell/init.sh
source /root/G1SMS/shell/functions.sh
log "sms_COUNT.sh ($1=phone $2=NOSMS)"
PHONE=$1
# Initialise PHONE, PIN, PUBKEY, UNIT, HIST
sms_INIT_ACCOUNT "$PHONE" "NOSMS"
if [[ $UNKNOWN == "unknown" ]]; then
sms_ERROR "$PHONE" "Porte-monnaie inconnu. Envoyez N pour le créer."
exit
fi
# Check account amount
AMOUNTG1=$(./silkaj/silkaj amount --auth-scrypt -salt="$PHONE" -password="$PIN")
AMOUNTDU=$(bc <<< "scale=2; $AMOUNTG1 / $DUFACTOR")
AMOUNTLOVE=$(bc <<< "$AMOUNTG1 * 100 / $DUFACTOR")
case "$UNIT" in
G1)
AMOUNT=$AMOUNTG1
;;
DU)
AMOUNT=$AMOUNTDU
;;
*)
AMOUNT=$AMOUNTLOVE
;;
esac
# LOG
log "Solde = $AMOUNT ($UNIT)"
# If script control only run: NOSMS
if [ "$2" != "NOSMS" ]; then
mess="[G1SMS]
Compte: $PHONE
Solde: $AMOUNT $UNIT
"
# Send response SMS
sms_SEND "$PHONE" "$mess"
else
echo $AMOUNTG1
fi
exit
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment