Making alias in the telnet busybox permanent

Discussion in 'Tomato Firmware' started by Kiwi8, Dec 7, 2007.

  1. Kiwi8

    Kiwi8 LI Guru Member

    Hello folks!

    I run quite a couple of commands on the busybox CLI using telnet. Is there anyway I can make the aliases that I create permanent upon router reboot?

    Thanks in advance.
  2. tievolu

    tievolu Network Guru Member

    Enter the commands to create the aliases into the Init script:

    Administration -> Scripts -> Init

    They will then be created every time the router boots.
  3. mstombs

    mstombs Network Guru Member

    I managed to do this on a Linux modem - needed to use the equivalent of an init script to add the entry to a "profile" tmp file. The problem is that each script is created/run in a separate shell process, you need to change the defaults when a new one is created or changes are not 'sticky'.


    echo 'alias dir="ls -laF"' >>/etc/profile
    doesn't work with Tomato because the file is store on the rom readonly file system. The best I can suggest is to write a small file with them in, store in /jffs or create from init into /var, then its only one command to remember!
  4. Kiwi8

    Kiwi8 LI Guru Member

    Sorry folks. Both your suggestions do not work. :redface:
  5. PeterT

    PeterT Network Guru Member

    Try this

    In the INIT script add
    cat > /tmp/home/root/.profile <<EOF
      alias dir="ls -laF"
      alias home="cd /tmp/home/root"
      or what other commands you want to excute when you logon
  6. Kiwi8

    Kiwi8 LI Guru Member

    Thanks, this works. :)
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice