forked from axiom-team/astroport
61 lines
1.6 KiB
Bash
61 lines
1.6 KiB
Bash
|
#!/bin/bash
|
||
|
################################################################################
|
||
|
# Author: Fred (support@qo-op.com)
|
||
|
# Version: 0.1
|
||
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||
|
################################################################################
|
||
|
source ./shell/init.sh
|
||
|
source ./shell/functions.sh
|
||
|
log "${c_yellow}X sms_NEW.sh ($1=phone, $2=uid)$c_"
|
||
|
|
||
|
PHONE="$1"
|
||
|
MEMBERUID="$2"
|
||
|
|
||
|
# Initialise PHONE, PIN, PUBKEY, UNIT
|
||
|
sms_INIT_ACCOUNT "$PHONE"
|
||
|
if [[ "$MEMBERUID" != "" && "$MEMBERUID" != "N" && "$MEMBERUID" != "D" && "$MEMBERUID" != "NOUV" ]]; then
|
||
|
# UID RECEIVED in SMS
|
||
|
VIRDEST=$MEMBERUID
|
||
|
MEMRIB=$(sms_uid2key "$MEMBERUID" "$PHONE" "$PIN")
|
||
|
if [[ $MEMRIB == "" ]]; then exit; fi
|
||
|
MEMBER="$MEMBERUID"
|
||
|
fi
|
||
|
|
||
|
sms_INIT_ACCOUNT "$PHONE" "NOSMS"
|
||
|
# Check account amount
|
||
|
countvalues=($(check_account))
|
||
|
log "$(declare -p countvalues)"
|
||
|
AMOUNTG1=${countvalues[0]}
|
||
|
AMOUNT=${countvalues[1]}
|
||
|
UNIT=${countvalues[2]}
|
||
|
|
||
|
mess="[G1sms+]
|
||
|
Id: $UIDNA
|
||
|
Solde: $AMOUNT $UNIT
|
||
|
DAB: $DABID
|
||
|
---
|
||
|
https://cesium.app
|
||
|
* Identifiant ="
|
||
|
sms_SEND "$PHONE" "$mess"
|
||
|
sleep 2
|
||
|
sms_SEND "$PHONE" "$PHONE"
|
||
|
sleep 2
|
||
|
sms_SEND "$PHONE" "* Mot de passe ="
|
||
|
sleep 2
|
||
|
sms_SEND "$PHONE" "$PIN"
|
||
|
sleep 2
|
||
|
sms_SEND "$PHONE" "* Clef Publique (RIB) ="
|
||
|
sleep 2
|
||
|
sms_SEND "$PHONE" "$PUBKEY"
|
||
|
sleep 2
|
||
|
[[ $MEMRIB != "" ]] && sms_SEND "$PHONE" "Compte relié? $MEMBER $MAIL
|
||
|
$MEMRIB"
|
||
|
|
||
|
# Add contact to database
|
||
|
add_contact $PHONE $MEMBERUID && log "${c_green}Contact has been added to database$c_" || log "${c_red}Contact can't be added to database$c_"
|
||
|
|
||
|
log "${c_yellow}END sms_NEW.sh$c_"
|
||
|
log "~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
||
|
exit
|
||
|
|