Aha, now I get what you're asking about! We had the exact same thoughts when we first started testing this feature.
It’s really an unfortunate combination of poor documentation and a design flaw in the SMS script execution functionality. You don’t get any info about which number triggered the scripts as preset variables or anything like you do with DHCP scripts, so you have to reverse-engineer the SMS content to match the script command and then extract the phone number from it.
In this case, you need to look for SMS messages with the exact phrase ':cmd SECRET script systemcommand command=reboot', like in the example below. Of course, you can use other regex combinations to match the command. IMO, it's a somewhat dirty solution, but it works!
/tool sms inbox
:local msg [get [([find where message~"^:cmd SECRET script systemcommand command=reboot.*"]->0)]]
:local phone ($msg->"phone")
Find the message matching the command (returns an array):
:local arr [find where message~"^:cmd SECRET script systemcommand command=reboot.*"]
Get the index of the first element (like picking the first match):
:local idx ($arr->0)
Retrieve the actual SMS content:
:local msg [get $idx]
Extract the phone number from the SMS:
:local phone ($msg->"phone")
Hope this clears it up for you!