# .bashrc

# User specific aliases and functions

# Source global definitions
#if [ -f /etc/bashrc ]; then
#	. /etc/bashrc
#fi

function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;35m\]"
local LIGHT_RED="\[\033[1;35m\]"
local WHITE="\[\033[1;37m\]"
local NO_COLOUR="\[\033[0m\]"
case $TERM in
    xterm*|rxvt*)
        TITLEBAR='\[\033]0;\u@\h:\w\007\]'
        ;;
    *)
        TITLEBAR=""
        ;;
esac

if [ "_$SHELL" = "_/bin/rbash" ]; then
        RESTR=$BLUE[$NO_COLOUR-restricted-$BLUE]
else
        RESTR=$BLUE[$NO_COLOUR-standard-$BLUE]
fi

DATESTRG="+%Y-%m-%d %H:%M %Z"

PS1="${TITLEBAR}\
$BLUE[$RED\$(date \"$DATESTRG\")$BLUE] $RESTR [$NO_COLOUR-Barracuda Networks-$BLUE]$NO_COLOUR
$BLUE[$LIGHT_RED\u@\h:\w$BLUE]\
$NO_COLOUR\$$NO_COLOUR "
PS2='> '
PS4='+ '
}

# are we an interactive shell?
if [ "$PS1" ]; then
    if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal
        stty erase `tput kbs`
    fi
    case $TERM in
        xterm*)
            PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
            ;;
        *)
            ;;
    esac
    # set prompts here 
    proml
    #PS1="[\u@\h \W]\\$ "

    if [ "x$SHLVL" != "x1" ]; then # We're not a login shell
        for i in /etc/profile.d/*.sh; do
            if [ -x $i ]; then
                . $i
            fi
        done
    fi
fi


echo ""
echo "******----> You just opened a restricted service account. Note that your activities will be recorded."
echo "******----> Transfered files may be automatically deleted upon logout." 
echo ""

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/phion/bin:/etc/phion/bin

export PATH
