#!/bin/sh
## bashrc for bashrc in /home/ctaf/.ctafconf
##
## Made by GESTES Cedric
## Login <ctaf@epita.fr>
##
## Started on Fri Sep 30 22:08:35 2005 GESTES Cedric
## Last update Fri May 5 17:25:38 2006 GESTES Cedric
##
#!/bin/sh
if [[ $- != *i* ]] || [ a$HOST = agate-ssh ]; then
# Shell is non-interactive. Be done now
return
fi
echo -n "shell: bash, "
cat ~/.ctafconf/etc/shell/motd
#date reminder
~/.ctafconf/bin/ct-date
# Bash won't get SIGWINCH if another process is in the foreground.
# Enable checkwinsize so that bash will check the terminal size when
# it regains control. #65623
# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
shopt -s checkwinsize
# Set colorful PS1 only on colorful terminals.
# dircolors --print-database uses its own built-in database
# instead of using /etc/DIR_COLORS. Try to use the external file
# first to take advantage of user additions.
use_color=false
safe_term=${TERM//[^[:alnum:]]/.} # sanitize TERM
if [[ -f /etc/DIR_COLORS ]]; then
grep -q "^TERM ${safe_term}" /etc/DIR_COLORS && use_color=true
elif dircolors --print-database 2>/dev/null | grep -q "^TERM ${safe_term}"; then
use_color=true
elif gdircolors --print-database 2>/dev/null | grep -q "^TERM ${safe_term}"; then
use_color=true
fi
if ${use_color}; then
if [[ $EUID == 0 ]]; then
PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]'
else
PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\w \$ \[\033[00m\]'
fi
else
if [[ $EUID == 0 ]]; then
# show root@ when we don't have colors
PS1='\u@\h \W \$ '
else
PS1='\u@\h \w \$ '
fi
fi
[ -f ~/.ctafconf/etc/shell/globalenv ] && . ~/.ctafconf/etc/shell/globalenv sh
[ -f ~/.ctafconf/etc/shell/alias ] && . ~/.ctafconf/etc/shell/alias
[ -f ~/.ctafconf/etc/bash/bashprompt ] && . ~/.ctafconf/etc/bash/bashprompt
[ -f ~/.ctafconf/perso/bashrc.mine ] && ~/.ctafconf/perso/bashrc.mine