I updated my RUT951 from firmware 7.11.3 to 7.16.3. This has broken a custom script that uses parameters. The symptom is that shell parameters $* returns an empty string instead of the words in the SMS after the initial keyword used to trigger the custom script rule. (I am also using $SMS_FROM to access the phone number that sent the SMS, and this still works.) Here is the text of the script, for information:
#!/bin/sh
echo $SMS_FROM $* | mosquitto_pub -h hostname -t topic -l
exit 0
where hostname is the local hostname of a Raspberry Pi 4, and topic is the Mosquitto topic. Code on the Pi 4 needs to interpret the $* parameters (several actions are possible, depending on the words used). The code on the Pi4 reports an empty string where it should have received the words in the SMS message.
Hello,
Could you share the exact path/location where this script is stored?
Additionally, how are you currently reading the SMS content—are you using ubus call
or another method?
It may also be worth trying to place the SMS text into a different variable, e.g., to $SMS_TEXT
.
Best regards,
I don’t know where the script is stored. I entered it into the RUT951 WebUI under SMS Utilities/Custom Script. Apologies for not making this clear in my original post. I don’t read the SMS content. The SMS Utilities passes the text of the SMS as parameters to the custom script. These are something like: keyword heater on. The keyword triggers the custom script, the second and third are passed as parameters to the custom script using $* as in my original post, then passed on as a MQTT message to code running on my Raspberry Pi 4, which interprets the parameters, and acts upon them.