summaryrefslogtreecommitdiffstats
path: root/debian/local/bash/profile.d/zz-bash.sh
blob: 9f88421498fe91dc8f62c67d283bcd312d28c364 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# /etc/profile.d/zz-bash.sh

export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"

if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]
then
	if [ "$(id -u)" -eq 0 ]
	then
		if [ -n "$SSH_CONNECTION" ]
		then
			PS1="\[\033[1;31m\]\u\[\033[0m\]@\H:\w\\$ "
		else
			PS1="\[\033[1;31m\]\u\[\033[0m\]:\w\\$ "
		fi
	else
		if [ -n "$SSH_CONNECTION" ]
		then
			PS1="\[\033[1;32m\]\u\[\033[0m\]@\H:\w\\$ "
		else
			PS1="\[\033[1;32m\]\u\[\033[0m\]:\w\\$ "
		fi
	fi

	HISTCONTROL="ignoredups:ignorespace"
	HISTFILESIZE="100000"
	HISTSIZE="100000"

	shopt -s cdspell
	shopt -s checkwinsize
	shopt -s histappend
	shopt -s histverify
	shopt -s no_empty_cmd_completion
fi

alias logoff="unset HISTORY; unset HISTFILE; exit"