## check if shell is interactive case "$-" in *i*) _bash_interactive="true" ;; *) _bash_interactive="false" ;; esac if [ "${_bash_interactive}" = "true" ]; then ## terminal attributes test -x "$(type -p setterm)" && { echo -e " \033[1;33m*\033[m \033[1;1msetting terminal attributes\033[m"; setterm -blank 0 -blength 50 -bfreq 4000; echo } ## system information echo -e " \033[1;34m*\033[m \033[1;1muname\033[m"; uname -a; echo ## uptime echo -e " \033[1;34m*\033[m \033[1;1muptime\033[m"; uptime; echo ## uptime records test -x "$(type -p uprecords)" && { echo -e " \033[1;34m*\033[m \033[1;1muptime records\033[m"; uprecords; echo } ## show who is logged on echo -e " \033[1;34m*\033[m \033[1;1mwho\033[m"; who -Hu; echo ## fortune test -x "$(type -p fortune)" && { echo -e " \033[1;34m*\033[m \033[1;1mfortune\033[m"; fortune -s; echo } ## ssh-keychain (http://www.gentoo.org/projects/keychain/) test -x "$(type -p keychain)" && { KEYCHAIN_KEY_LIST="${HOME}/.ssh/id_dsa" # space separated list of ssh-keys function keychain_check_keys() { for KEY in $*; do test -r ${KEY} || return 1; done; return 0 } keychain_check_keys ${KEYCHAIN_KEY_LIST} && { echo -e " \033[1;34m*\033[m \033[1;1mkeychain\033[m"; keychain --clear ${KEYCHAIN_KEY_LIST} } } ## devtodo (http://devtodo.sf.net/) test -x "$(type -p todo)" && test -r ~/.todo && { echo -e " \033[1;34m*\033[m \033[1;1mtodo\033[m\n"; todo --database ~/.todo; echo } fi ## source bashrc readonly _HOMEBASH_PROFILE=true test -r ~/.bashrc && . ~/.bashrc