Untitled

From anonymous, 3 Months ago, written in Plain Text, viewed 45 times.
URL https://paste.codexterous.com/view/4e52c1e3 Embed
Download Paste or View Raw
  1. #
  2. # ---- Set global vars
  3. #
  4. export TERM=xterm-256color;
  5. CLICOLOR=1;             export CLICOLOR
  6. PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/X11R6/bin:/usr/local/games:/usr/local/sbin:/usr/local/bin:~/bin:/data/mail/bin:/share/bin:/share/sbin:/usr/local/ateam/bin:/usr/local/ateam/sbin:/usr/local/mimas/bin
  7.                         export PATH
  8. MANPATH=/usr/local/man:/usr/man:/usr/share/man/:/usr/X11R6/man:$MANPATH;
  9.                         export MANPATH;
  10. PAGER=more;             export PAGER
  11. EDITOR=nano;           export EDITOR
  12. export GREP_COLOR=31
  13. alias grep='grep --color=always'
  14.  
  15. # -- Needed for LDAP/PAM MySQL authentication
  16. export LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN=1; export LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN;
  17.  
  18. #
  19. # ---- Turn on messaging and set the umask
  20. #
  21. #mesg y
  22. umask 022
  23.  
  24. #
  25. # ---- Figure out the capabiltiies of the terminal
  26. #
  27. # This is problematic because tput is based off of the termcap
  28. # which a lot of times isn't aware of 256, so we're going to
  29. # lean towards that most of the time
  30. #
  31. if [ "${TERM}"x == "xterm-256color"x ]; then
  32.    __TERM_COLORS="256";
  33. fi
  34.  
  35. if [ "${TERM}"x == "linux"x ]; then
  36.    __TERM_COLORS="256";
  37. fi
  38.  
  39. if [ "${TERM}"x == "xterm"x ]; then
  40.    # ---- FreeBSD's console now reports as this
  41.  
  42.    if tty | grep "ttyv" > /dev/null; then
  43.       # -- We're on a 'real' console TTY
  44.       __TERM_COLORS="16";
  45.    else
  46.       __TERM_COLORS="256";
  47.    fi
  48. fi
  49.  
  50. if [ "${TERM}"x == "screen"x ]; then
  51.    __TERM_COLORS="256";
  52. fi
  53.  
  54. if [ "${__TERM_COLORS}"x == ""x ]
  55.    then
  56.    __TPUT_REPORTS=`tput colors 2> /dev/null`;
  57.    if [ -z "${__TPUT_REPORTS}" ]; then
  58.       __TERM_COLORS="16";
  59.    elif [ $__TPUT_REPORTS -gt 126 ]; then
  60.       __TERM_COLORS="256";
  61.    else
  62.       __TERM_COLORS="16";
  63.    fi
  64. fi
  65.  
  66. PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: `pwd`\007"';  # Sets the window title
  67.  
  68. #
  69. # ---- Set the prompt based on current user (root or not) and term capabilities
  70. #
  71. if [ ${UID}x == "0"x ]; then
  72.    # ---- Root
  73.    #
  74.  
  75.    # -- Adjust timezone to system's time
  76.    export TZ="../../../etc/localtime";
  77.    TZABV=`date | awk '{print $5}'`;
  78.  
  79.    # -- Set promot vs. capabilities
  80.    if [ "$__TERM_COLORS"x == "256"x ]; then
  81.       PS1='\n\[\e[38;05;236m\]-\[\e[0m\] \[\e[38;05;196m\]\u\[\e[0m\]\[\e[38;05;236m\] - \[\e[0m\]\[\e[38;05;147m\]\h\[\e[0m\]\[\e[38;05;103m\].`echo \H | sed "s/\h.//g"`\[\e[0m\]\[\e[38;05;236m\] -\[\e[0m\] \[\e[38;05;184m\]\w\[\e[0m\]\[\e[38;05;236m\] - \[\e[0m\]\[\e[38;05;144m\]\t\[\e[0m\] \[\e[38;05;101m\]${TZABV}\[\e[0m\]\[\e[38;05;236m\] \[\e[0m\]\n\[\e[38;05;236m\]>\[\e[0m\]\[\e[38;05;239m\]>\[\e[0m\]\[\e[38;05;243m\]>\[\e[0m\]\[\e[38;05;246m\]>\[\e[0m\] ';
  82.    else
  83.       PS1='\n\[\e[30;1m\]-\[\e[0m \[\e[31;1m\]\u\[\e[0m\[\e[30;1m\] - \[\e[0m\[\e[36;1m\]\h\[\e[0m\[\e[36m\].`echo \H | sed "s/\h.//g"`\[\e[0m\[\e[30;1m\] -\[\e[0m \[\e[33;1m\]\w\[\e[0m\[\e[30;1m\] - \[\e[0m\[\e[37;1m\]\t\[\e[0m \[\e[37m\]${TZABV}\[\e[0m\n\[\e[30;1m\]>\[\e[0m\[\e[30;1m\]>\[\e[0m\[\e[37m\]>\[\e[0m\[\e[37;1m\]>\[\e[0m\] ';
  84.    fi
  85. else
  86.    # ---- User
  87.    #
  88.    TZABV=`date | awk '{print $5}'`;
  89.  
  90.    # -- Set promot vs. capabilities
  91.    if [ "${__TERM_COLORS}"x == "256"x ]; then
  92.       PS1='\n\[\e[38;05;236m\]-\[\e[0m\] \[\e[38;05;107m\]\u\[\e[0m\]\[\e[38;05;236m\] - \[\e[0m\]\[\e[38;05;147m\]\h\[\e[0m\]\[\e[38;05;103m\].`echo \H | sed "s/\h.//g"`\[\e[0m\]\[\e[38;05;236m\] -\[\e[0m\] \[\e[38;05;184m\]\w\[\e[0m\]\[\e[38;05;236m\] - \[\e[0m\]\[\e[38;05;144m\]\t\[\e[0m\] \[\e[38;05;101m\]${TZABV}\[\e[0m\]\[\e[38;05;236m\] \[\e[0m\]\n\[\e[38;05;236m\]>\[\e[0m\]\[\e[38;05;239m\]>\[\e[0m\]\[\e[38;05;243m\]>\[\e[0m\]\[\e[38;05;246m\]>\[\e[0m\] ';
  93.    else
  94.       PS1='\n\[\e[30;1m\]-\[\e[0m \[\e[32;1m\]\u\[\e[0m\[\e[30;1m\] - \[\e[0m\[\e[36;1m\]\h\[\e[0m\[\e[36m\].`echo \H | sed "s/\h.//g"`\[\e[0m\[\e[30;1m\] -\[\e[0m \[\e[33;1m\]\w\[\e[0m\[\e[30;1m\] - \[\e[0m\[\e[37;1m\]\t\[\e[0m \[\e[37m\]${TZABV}\[\e[0m\n\[\e[30;1m\]>\[\e[0m\[\e[30;1m\]>\[\e[0m\[\e[37m\]>\[\e[0m\[\e[37;1m\]>\[\e[0m\] ';
  95.    fi
  96. fi
  97.  
  98. export PS1;
  99.  

Reply to "Untitled"

Here you can reply to the paste above