From c09fecdb899e3854f7e59cff21be6a2fb2dfbe0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Wed, 8 Jun 2022 18:33:53 +0200 Subject: [PATCH] add function for finding local logins --- functions.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions.sh b/functions.sh index 4af9db6..428d537 100755 --- a/functions.sh +++ b/functions.sh @@ -1154,7 +1154,7 @@ function getdbcreds_cnf () { DB_PORT="$(echo $DB_URL|sed 's@^.*//@@;s@\(^.*\):\(.*\)/\(.*\)$@\2@')" DB_NAME="$(echo $DB_URL|sed 's@^.*//@@;s@\(^.*\):\(.*\)/\(.*\)$@\3@')" - cd - + #cd - return 0 } function connectdb () { @@ -1203,4 +1203,7 @@ urldecode() { printf '%b' "${url_encoded//%/\\x}" } +findlocallogins() { + last -F -a $(for i in $(find /var/log -maxdepth 1 -name "wtmp*"|sort -h);do echo -n "-f $i ";done)|grep -v "pts/\|reboot\|wtmp"|awk '{print $4,$5,$7}'|uniq +} #EOF