1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What does the following do?

Discussion in 'Tomato Firmware' started by Kiwi8, Sep 21, 2010.

  1. Kiwi8

    Kiwi8 LI Guru Member

    "[ $1 -ge 20 ] && telnetd -p 233 -l /bin/sh"

    Thanks in advance.
     
  2. TexasFlood

    TexasFlood Network Guru Member

    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?
     
  3. RonWessels

    RonWessels Network Guru Member

    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".
     
  4. but2002

    but2002 Networkin' Nut Member

    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.
     

Share This Page