调用gammu或gammu-smsd-inject

时间:2016-04-27 17:40:26

标签: raspberry-pi2 debian-based gammu

我和gessie一起在树莓派上运行gammu-smsd。我使用runonreceive来处理传入的文本。我有以下脚本使用runonreceive。在脚本中,我正在调用gammu sentms而不是gammu-smsd-inject作为文档说明。当gammu-smsd守护程序运行时,所有其他引用状态gammu将不起作用。我让这个工作的唯一原因是拔掉我的头发试图让gammu-smsd-inject工作。谁能解释一下发生了什么?

RunOnReceive = /home/jaalfs/bin/sms_back.sh

sms_back.sh

#!/bin/bash
from=$SMS_1_NUMBER
echo "sms_back" >> /home/jaalfs/bin/sms_back.log
echo "Test from: $from" >> /home/jaalfs/bin/sms_back.log
echo -e "\n"
if [ "$from" != "+1310xxxxxxx" ]; then
    echo -e "not accepted number \n" >> /home/jaalfs/bin/sms_back.log
    exit 0
else
    echo "accepted number" >> /home/jaalfs/bin/sms_back.log
    echo "hello world!!!!!!" | sudo gammu sendsms TEXT "$from"
    echo -e " text sent back \n" >> /home/jaalfs/bin/sms_back.log
    exit 0
fi
exit 1

0 个答案:

没有答案