#!/bin/bash #-------------------------------------------------------------------- # $Id: login,v 0.1 2008/06/23 10:17:41 tmerkel Exp $ # Copyright 2008 Frubar Network (drscream@frubar.net) #-------------------------------------------------------------------- ########################################################################## if [[ ${EUID} == 0 ]] ; then return fi ########################################################################## test -x "$(type -p setterm)" && { setterm -blank 0 -blength 0; } YELLOW=$'\033[1;33m' LBLUE=$'\033[1;36m' BLUE=$'\033[1;34m' LRED=$'\033[1;31m' RED=$'\033[1;38m' if [[ "$TERM" != "screen" ]]; then ## ... echo ## system information echo -e "$BLUE*\033[m \033[1;1muname\033[m"; uname -snrmpo; echo ## uptime (records) if [ -x "$(type -p uprecords)" ]; then echo -e "$BLUE*\033[m \033[1;1muptime records\033[m"; uprecords -m 3 -s; echo else echo -e "$BLUE*\033[m \033[1;1muptime\033[m"; uptime | sed "s/^ //"; echo fi ## show who is logged on echo -e "$BLUE*\033[m \033[1;1mwho\033[m"; who -Hu; echo ## check doc.env status # test -d ${DOC_HOME}/.doc.env && { # cd .doc.env # get_local_revision # get_remote_revision # if [ ${svn_remote} -gt ${svn_local} ]; then # echo -e "$LRED*\033[m \033[1;1msvn\033[m"; # echo "old local copy (r:${svn_remote}, l:${svn_local})"; echo # fi # cd ~ # } fi ## fortune on every login test -x "$(type -p fortune)" && { echo -e "$BLUE*\033[m \033[1;1mfortune\033[m"; fortune -s; echo }