another try

This commit is contained in:
qo-op 2021-07-12 19:50:42 +02:00
parent 0b58333561
commit 717f1041f8
1 changed files with 4 additions and 1 deletions

View File

@ -41,9 +41,12 @@ PHONE="$SMS_1_NUMBER" # gammu-smsd
[[ ${PHONE#"$prefix"} != "${PHONE}" ]] && phone=0${PHONE#"$prefix"} || phone="${PHONE}"
TEXT=""
PROGRAM=/bin/echo
for i in `seq $SMS_MESSAGES` ; do
TEXT="$TEXT $(cat /var/spool/gammu/inbox/${SMS_${i}_TEXT})"
eval "$PROGRAM \"\${SMS_${i}_NUMBER}\" \"\${SMS_${i}_TEXT}\"" >> /tmp/sms_message
done
[[ ! ${TEXT} ]] && TEXT="$2" # CLI MODE
[[ "${TEXT}" == "" ]] && echo "SMS IS EMPTY - EXIT -" && exit 1