2019-11-27 23:43:32 +01:00
|
|
|
#!/bin/bash
|
|
|
|
##################################################################
|
|
|
|
# Author: Fred (support@qo-op.com)
|
|
|
|
# Version: 0.1
|
|
|
|
# License: GPL (http://www.google.com/search?q=GPL)
|
|
|
|
##################################################################
|
|
|
|
# Adapter les valeurs au contexte spatio-temporel du NODE G1SMS
|
|
|
|
function log () {
|
|
|
|
# log ($1=text)
|
|
|
|
if [ "$DOLOG" == "YES" ]
|
|
|
|
then
|
2019-11-29 15:40:22 +01:00
|
|
|
echo "$PHONE:$1" >> $LOG_FILE
|
2019-11-27 23:43:32 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2019-11-29 15:40:22 +01:00
|
|
|
### Déclaration de l'environnement
|
|
|
|
source .env
|
2019-11-27 23:43:32 +01:00
|
|
|
|
|
|
|
fn_exists() {
|
|
|
|
# appended double quote is an ugly trick to make sure we do get a string -- if $1 is not a known command, type does not output anything
|
|
|
|
[ `type -t $1`"" == 'file' ]
|
|
|
|
}
|
|
|
|
# ATOMATIC gammu-smsd-inject desactivation if no gammu is installed on system
|
|
|
|
if ! fn_exists gammu-smsd-inject; then
|
|
|
|
log ":p) DESACTIVATION ENVOI DE SMS .............."
|
|
|
|
function gammu-smsd-inject () {
|
|
|
|
log "$PHONE: >>> SENDING SMS $4 TO $2 "
|
|
|
|
}
|
|
|
|
else
|
|
|
|
export G1SMS="YES"
|
|
|
|
fi
|