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

Debian-like prompts

Discussion in 'Tomato Firmware' started by rhester72, Jun 18, 2009.

  1. rhester72

    rhester72 Network Guru Member

    I like my default Debian prompts - so much that I wanted to see them on Tomato as well. This was inspired by another script on the forum which I was unable to find and properly credit the original author. Enjoy!

    Code:
    if [ -h /etc/profile ];then
     cp -f /rom/etc/profile /etc/profile
     echo HOST=\"`nvram get router_name`\">>/etc/profile
     echo 'do_cd() {
      cd $@
      if [ $USER = root ];then
       PS1C=#
      else
       PS1U="${USER}@"
       PS1C=$
      fi
      if [ $PWD != $HOME ];then
       PS1="${PS1U}${HOST}:${PWD}${PS1C} "
      else
       PS1="${PS1U}${HOST}:~${PS1C} "
      fi
      unset PS1C PS1U
     }
     alias cd=do_cd'>>/etc/profile
     echo cd>>/etc/profile
    fi
    
    Rodney
     

Share This Page