aboutsummaryrefslogtreecommitdiff
path: root/files/etc/profile
diff options
context:
space:
mode:
authordrebs <drebs@linux.ime.usp.br>2010-02-13 10:45:32 -0200
committerdrebs <drebs@linux.ime.usp.br>2010-02-13 10:45:32 -0200
commit76d2b8802fc5c26cd4fce2b8ad1e657010f16ef3 (patch)
tree51312a0cfb014524e1c473bcd041595ec2890bf7 /files/etc/profile
parent650bdd6770281b2067e531bd09e75a0f99126591 (diff)
downloadpuppet-nodo-76d2b8802fc5c26cd4fce2b8ad1e657010f16ef3.tar.gz
puppet-nodo-76d2b8802fc5c26cd4fce2b8ad1e657010f16ef3.tar.bz2
Changing PS1 info from /etc/bash.bashrc to /etc/profile
Diffstat (limited to 'files/etc/profile')
-rw-r--r--files/etc/profile55
1 files changed, 55 insertions, 0 deletions
diff --git a/files/etc/profile b/files/etc/profile
new file mode 100644
index 0000000..512e871
--- /dev/null
+++ b/files/etc/profile
@@ -0,0 +1,55 @@
+# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
+# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
+
+if [ "`id -u`" -eq 0 ]; then
+ PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+else
+ PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
+fi
+
+function command_prompt() {
+ exit_status="$?"
+# # colors
+ COLOR_RED="\[\033[31m\]"
+ COLOR_GREEN="\[\033[32;40m\]"
+ COLOR_YELLOW="\[\033[33;40m\]"
+ COLOR_BLUE="\[\033[34;40m\]"
+ COLOR_MAGENTA="\[\033[35;40m\]"
+ COLOR_CYAN="\[\033[36;40m\]"
+
+ COLOR_RED_BOLD="\[\033[31;1m\]"
+ COLOR_GREEN_BOLD="\[\033[32;1m\]"
+ COLOR_YELLOW_BOLD="\[\033[33;1m\]"
+ COLOR_BLUE_BOLD="\[\033[34;1m\]"
+ COLOR_MAGENTA_BOLD="\[\033[35;1m\]"
+ COLOR_CYAN_BOLD="\[\033[36;1m\]"
+
+ COLOR_NONE="\[\033[0m\]"
+ BOLD="\[\033[1m\]"
+
+ if [ "$exit_status" == "0" ]; then
+ status_color="${COLOR_GREEN}"
+ else
+ status_color="${COLOR_RED_BOLD}"
+ fi
+
+ PS1="\n${COLOR_RED}\D{%A - %d/%m/%Y - %H:%M:%S} - ${COLOR_YELLOW}Exit status: ${status_color}${exit_status}${COLOR_NONE}\n${COLOR_GREEN}\u@\h${COLOR_NONE}:${COLOR_CYAN}\w${COLOR_NONE} \$ "
+ PS2="${BOLD}>${OFF} "
+}
+
+if [ "$PS1" ]; then
+ if [ "$BASH" ]; then
+ PS1='\u@\h:\w\$ '
+ PROMPT_COMMAND=command_prompt
+ else
+ if [ "`id -u`" -eq 0 ]; then
+ PS1='# '
+ else
+ PS1='$ '
+ fi
+ fi
+fi
+
+export PATH
+
+umask 022