我在linux上有一個華爲E220 HSDPA調制解調器xubuntu 我想收到短信並自動回覆發件人。 我使用gammu和Gammu-smsd來做到這一點。在huawei調制解調器,gammu-smsd上收到並回復短信:進程失敗,退出狀態2
要自動發送短信,我將runOnRecieve =/path/to/bash /文件添加到/ etc/gammu-smsdrc配置文件中。
下面是腳本:
#!/bin/bash
str=$SMS_1_TEXT //string containing text from sender
tlf=$SMS_1_NUMBER //containing number from sender
tlf=${tlf:3}
if test "$str" = "today"; then
echo "[Weather for today in Norway]
Sol, noe overskyet
[Vind fra sørøst]
Ha en fin dag!" | gammu-smsd-inject TEXT $tlf -unicode -autolen 200
else
echo "fail" >> /home/mattis/sms.txt
fi
我這是怎麼開始的守護
$ sudo gammu-smsd
這工作,如果我使用測試輸入,從終端上運行bash腳本,但是當節目監務-smsd調用我得到的腳本。
gammu-smsd[3183]: Process failed with exit status 2
現在我可以從代碼中刪除「監務-SMSD-注入」,並以「監務sendsms」取代,但這只是給我的廢話,而不是字母「æøå和[]」收到回時移動。
希望得到積極的答案。
即使我遇到這個問題,我已經填入https://github.com/gammu/gammu/issues/39 – Darick