subscribe to our Youtube


13386 questions

15914 answers


50508 members

0 votes
67 views 1 comments


I have a RUTX12 with firmware RUTX_R_00.07.03.1.

I am testing the creation of SMS utilities custom rule with "Execute custom script" action.

If I create a new rule with "SMS text" set to "toto", the rule is triggered by sending sms with "toto" content but also by any sms that starts with "toto". It is very tempting to use that behavior to send parameters to the custom shell script itself :-)

I haven't been able to get the original sms content to parse it. I tried basic "$*", "$1", ... shell variables but they are empty. I also tried to get the sms using gsmctl -S -t and gsmctl -S -r N but sms handled with sms rules does not seems to be saved.

It seems to be possible, as "uci" rules does it, but it is a built-in rule. So my question is, is it possible to get the sms "parameters" or the full sms content in the shell script of a "Execute custom script" ? If so, how to do it ?

Thanks for your help.

1 Answer

+1 vote


I've tested this out and while that is the case, it would be very hard to actually utilize this to pass extra arguments. This is because after receiving an SMS that matches one of the SMS rules, it automatically gets deleted afterward.

One way this theoretically could be achieved is by setting the SMS storage limit to 1 and creating an SMS rule, that would trigger a separate shell script. This script would be waiting for a new message to arrive (by periodically checking the output of command ubus call gsm.modem0 read_sms '{"index":1}' ). Then the user would send an SMS with the command that should be executed, and the running script would execute it.

I've not tried this and I'm sure there would be a lot of issues to overcome.

Thankfully, this feature is currently in the progress of being implemented and should appear in v7.4 of RutOS if all goes according to plan.

Best regards,


The workaround seems a bit complicated for a few months until the release. I will rework my use cases to simplify them and duplicates custom rules in the mean time.

Thank you for your help.