###################################################################################
# A T T E N T I O N ! #
# This file is under puppet control! Do NOT make changes manually! #
###################################################################################
if [ "$PS1" ]; then
if [[ "${USER}" =~ hc_.+\. ]] || [ "${USER}" == wh ] || [ "${USER}" == la2 ] || [ "${USER}" == netops ] || [ "${USER}" == dcops ] || [ "${USER}" == phantoms ] || [ "${USER}" == devils ] || [ "${USER}" == root ] || [ "${USER}" == techsup ] || [ "${USER}" == emailcs ]
then
if [[ "${TERM}" == xterm* ]] || [ "${TERM}" == screen ]
then
echo -ne "\033]0;${USER}@${HOSTNAME%%.*}"; echo -ne "\007"
fi
#for logins via ipmi/idrac console or VNC
tty=$(tty)
if [[ ${tty} =~ 'tty' ]]; then
export SSH_TTY=$tty
export SSHD_USER=$USER
fi
if [ -z "${SSHD_USER}" ]; then
SSHD_USER=$(cat /proc/$PPID/environ 2>/dev/null| tr '\0' '\n' | grep '^SSHD_USER' | cut -d"=" -f2)
#set SSHD_USER for Namecheap
if [ -n "${SSHD_USER}" ]; then
export SSHD_USER
#set SSHD_USER for Spaceship
else
SSHD_USER=$(ps -o user= -p $$)
pid="$$"
while [ "${SSHD_USER}" == 'root' ]
do
ppid=$(cat /proc/$pid/status | grep "PPid" | awk '{print $2}')
pid=$ppid
SSHD_USER=$(ps -o user= -p "${ppid}")
export SSHD_USER
done
fi
fi
#set SSH_TTY for both - Namecheap and Spaceship
pid="$$"
while [ -z "${SSH_TTY}" ]
do
ppid=$(cat /proc/$pid/status | grep "PPid" | awk '{print $2}')
pid=$ppid
export SSH_TTY=$(tr '\0' '\n' < /proc/"${ppid}"/environ | grep '^SSH_TTY' | cut -d'=' -f2)
done
export PROMPT_COMMAND='history -a >(tee -a ~/.bash_history |logger -p local4.alert -t "$SSHD_USER:[$USER]:[$SSH_TTY]:[$PWD]")'
elif [[ -d /dev/fd && -d /var/.cagefs ]]
then
unset HISTTIMEFORMAT
export PROMPT_COMMAND='history -a >(tee -a ~/.bash_history |logger -p local5.alert -t "${USER}:${PWD}")'
fi
fi
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| bash_timestamps.sh | File | 69 B | 0644 |
|
| colorgrep.csh | File | 196 B | 0644 |
|
| colorgrep.sh | File | 201 B | 0644 |
|
| colorls.csh | File | 1.7 KB | 0644 |
|
| colorls.sh | File | 1.57 KB | 0644 |
|
| colorsysstat.csh | File | 69 B | 0644 |
|
| colorsysstat.sh | File | 56 B | 0644 |
|
| colorxzgrep.csh | File | 162 B | 0644 |
|
| colorxzgrep.sh | File | 183 B | 0644 |
|
| colorzgrep.csh | File | 216 B | 0644 |
|
| colorzgrep.sh | File | 220 B | 0644 |
|
| cpanel-user-commands.sh | File | 513 B | 0644 |
|
| csh.local | File | 80 B | 0644 |
|
| debuginfod.csh | File | 674 B | 0644 |
|
| debuginfod.sh | File | 596 B | 0644 |
|
| gawk.csh | File | 1.08 KB | 0644 |
|
| gawk.sh | File | 757 B | 0644 |
|
| lang.csh | File | 2.43 KB | 0644 |
|
| lang.sh | File | 2.26 KB | 0644 |
|
| less.csh | File | 500 B | 0644 |
|
| less.sh | File | 253 B | 0644 |
|
| locallib.csh | File | 240 B | 0755 |
|
| locallib.sh | File | 288 B | 0755 |
|
| mc.csh | File | 49 B | 0644 |
|
| mc.sh | File | 153 B | 0644 |
|
| modules.csh | File | 105 B | 0644 |
|
| modules.sh | File | 448 B | 0644 |
|
| prompt.sh | File | 2.16 KB | 0644 |
|
| puppet-agent.csh | File | 91 B | 0644 |
|
| puppet-agent.sh | File | 373 B | 0644 |
|
| scl-init.csh | File | 284 B | 0644 |
|
| scl-init.sh | File | 637 B | 0644 |
|
| sh.local | File | 81 B | 0644 |
|
| vim.csh | File | 106 B | 0644 |
|
| vim.sh | File | 248 B | 0644 |
|
| which2.csh | File | 120 B | 0644 |
|
| which2.sh | File | 628 B | 0644 |
|