2020-05-01 15:19:51 +02:00
|
|
|
#!/bin/bash
|
|
|
|
##################################################################
|
|
|
|
# Author: Fred (support@qo-op.com)
|
2020-05-07 03:14:26 +02:00
|
|
|
# Version: 1.0
|
2020-05-01 15:19:51 +02:00
|
|
|
# License: GPL (http://www.google.com/search?q=GPL)
|
|
|
|
##################################################################
|
|
|
|
# Commande SMS: sms_ABO.sh
|
|
|
|
# ABO "$SERVICE" "$YESNO"
|
|
|
|
# Gère les Abonnements aux communications PUSH SMS
|
|
|
|
##################################################################
|
|
|
|
# TODO: Create information Channels and moderate OPT IN/OUT
|
2020-05-03 23:37:47 +02:00
|
|
|
source ./init.sh
|
|
|
|
source ./functions.sh
|
2020-05-01 15:19:51 +02:00
|
|
|
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"
|
|
|
|
add_contact $PHONE $MEMBER && log "${c_green}Contact has been added to database$c_" || log "${c_red}Contact can't be added to database$c_";
|
|
|
|
sms_SEND "$PHONE" "$MEMBER votre inscription annuaire est active"
|
|
|
|
;;
|
|
|
|
OFF)
|
|
|
|
log "Retrait Kalkun"
|
|
|
|
rm_contact $PHONE $MEMBER && log "${c_green}Contact has been deleted from database$c_" || log "${c_red}Contact can't be deleted database$c_";
|
|
|
|
sms_SEND "$PHONE" "$MEMBER retrait annuaire prise en compte..."
|
|
|
|
;;
|
|
|
|
|
|
|
|
MARCHE)
|
|
|
|
log "Avertissement G1 marchés"
|
|
|
|
# PARAMS could be "$distance" to Member GeoPoint...
|
|
|
|
;;
|
|
|
|
GCHANGE)
|
|
|
|
log "Création Alerte Annonce GCHANGE"
|
|
|
|
# PARAMS could be "$distance#$keyword" to search gchange.fr near Member GeoPoint...
|
|
|
|
;;
|
|
|
|
INFO)
|
|
|
|
log "Abonnement Newsletter"
|
|
|
|
# PARAMS could be "$distance#$keyword" to search gchange.fr near Member GeoPoint...
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# AIDE : ABO GCHANGE 100#maison...
|
|
|
|
log "Renvoyez AIDE..."
|
|
|
|
sms_SEND "$PHONE" "Cette commande est inactive..."
|
|
|
|
;;
|
|
|
|
esac
|