From cdedae5d6d191111d71be01cc8f550671ee87811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Wed, 6 Apr 2022 10:06:04 +0200 Subject: [PATCH] add script for fetching days with local logins --- bin/lastlocallogins | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 bin/lastlocallogins diff --git a/bin/lastlocallogins b/bin/lastlocallogins new file mode 100755 index 0000000..2eb563d --- /dev/null +++ b/bin/lastlocallogins @@ -0,0 +1,13 @@ +#!/bin/sh + +F="$(for i in $(find /var/log -maxdepth 1 -name "wtmp*"|sort -h);do echo -n "-f $i ";done)" +cat << EOF +----- +Alle Tage mit lokalen Logins +User: $USER +Host: $(hostname) +Files: $F +----- + +EOF +last -F -a $F |grep -v "pts/\|reboot\|wtmp"|awk '$1 == u {print $4,$5,$7}' u=$USER|uniq