add function for finding local logins

This commit is contained in:
Jakobus Schürz 2022-06-08 18:33:53 +02:00
parent 849f4cf4e4
commit c09fecdb89

View file

@ -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