[ Skip to content | Translations of this page | document source ]


juakin


#!/bin/sh
# Autor Exal de Jesus Garcia Carrillo <exal AT softwarelivre DOT org>
# Copyright (C) Exal de Jesus Garcia Carrillo


mes=`date | awk '{print $2}'`
dia=$1
mes2=$2

if [ -z $1 ]; then
 echo -e "uso: $0 <DIA>"
  exit 0
   fi

if [ -n $1 ] && [ -n $2 ]; then

tput setaf 1; echo -e "\n        Usuarios logeados el $1 de $2\n"
tput setaf 7

awk "/$mes2 +$dia/ && /Accepted/" /var/log/secure | \

awk 'BEGIN { print ""
             print "Mes  Dia     Hora     User       Desde         Protocolo"
             print "---  ---    ------    ----       -----         ---------" }
           { print $1, " ", $2, " ", $3, " ", $9, " ", $11, "   ", $14}
     END   { print "" }'

 exit 0
       fi


[ EN ] [ ES ] [PT]
Copyright (C) 2006,2007,2008 Exal de Jesus Garcia Carrillo
Last update: fevereiro 5, 2008

Valid XHTML 1.0 Strict Valid CSS!