Discussion in 'Tomato Firmware' started by Kiwi8, Sep 21, 2010.
"[ $1 -ge 20 ] && telnetd -p 233 -l /bin/sh"
Thanks in advance.
Looks like something I've seen before to run telnetd if the SES button is held down for, uh, more then 20 seconds I think?
It's shell script programming. Interestingly enough, "[" is the name of a program, typically linked to "test". The "$1" argument is evaluated by the shell as the first argument to the script. It, as well as "-ge", "20" and "]" are passed as arguments to the test program. The "&&" is a shell-ism that says to run the second command if the first command succeeds.
Bottom line, it says that if the first argument to the script is greater than or equal to 20, it runs telnetd with arguments "-p 223 -l /bin/sh".
That's used by the SES button to start an unpassworded telnet server on port 223
It's an emergency backup so you can telnet into your router if you messed something up, and the web UI / Telnet is down.