# --------------------------------------------------------------------------- # Non-interactive shells # # SSH automation and remote tools may invoke Bash non-interactively. # Do not print banners or status messages in those sessions. # ---------------------------------------------------------------------------
case $- in *i*) ;; *) return ;; esac
# --------------------------------------------------------------------------- # Standard interactive shell settings # ---------------------------------------------------------------------------
HISTCONTROL=ignoreboth shopt -s histappend
HISTSIZE=1000 HISTFILESIZE=2000
shopt -s checkwinsize
if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval"$(dircolors -b ~/.dircolors)" || eval"$(dircolors -b)"
aliasls='ls --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi
alias ll='ls -alF' alias la='ls -A' alias l='ls -CF'
proxy-on() { if proxy-working; then _proxy_export echo"[proxy] ON $PROXY_URL" return 0 else _proxy_unset echo"[proxy] Cannot enable proxy: tunnel or upstream proxy is unavailable" return 1 fi }
proxy-off() { _proxy_unset echo"[proxy] OFF" }
proxy-status() { local tunnel_status="OFF" local upstream_status="OFF" local shell_status="OFF"
if proxy-tunnel-available; then tunnel_status="ON"
if proxy-working; then upstream_status="ON" fi fi
if [[ "${http_proxy:-}" == "$PROXY_URL" ]] && [[ "${https_proxy:-}" == "$PROXY_URL" ]]; then shell_status="ON" fi
if [[ "$_PROXY_INITIAL_STATUS" == "ON" ]]; then echo"[ssh]" echo" Reverse proxy tunnel is healthy" echo echo"[proxy] ON $PROXY_URL" else echo"[ssh]" echo" Reverse proxy tunnel is unavailable" echo echo"[proxy] OFF" echo" Direct network will be used" fi