vn-ansible/roles/debian-base/files/profile.sh

48 lines
818 B
Bash
Raw Normal View History

2024-09-23 12:30:38 +00:00
#!/bin/bash
# Prompt
FQDN=$(hostname --fqdn)
if [[ $FQDN == *.verdnatura.es ]]; then
SHORT_HOST=${FQDN%.verdnatura.es}
case "$SHORT_HOST" in
*.dc)
ENVIRONMENT="\[\033[01;31m\]PRO\[\033[00m\]"
;;
*.lab)
ENVIRONMENT="\[\033[01;35m\]LAB\[\033[00m\]"
;;
*)
ENVIRONMENT="\[\033[01;32m\]VN\[\033[00m\]"
;;
esac
PS1="\u@$SHORT_HOST[$ENVIRONMENT]:\w"
if [ "$(id -u)" -eq 0 ]; then
PS1="$PS1# "
else
PS1="$PS1\$ "
fi
fi
# History
HISTSIZE=10000
HISTFILESIZE=50000
HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
# Security
TMOUT=3600
# Aliases
#export LS_OPTIONS='--color=auto'
#eval "$(dircolors)"
#alias ls='ls $LS_OPTIONS'
#alias ll='ls $LS_OPTIONS -l'
#alias la='ls $LS_OPTIONS -la'