1
0
mirror of https://github.com/AAAAAEXQOSyIpN2JZ0ehUQ/SSHPLUS-MANAGER-FREE.git synced 2024-11-27 06:09:04 +00:00
SSHPLUS-MANAGER-FREE/Modulos/uexpired
AAAAAEXQOSyIpN2JZ0ehUQ 0d8ac4d2db Update Script
2021-03-25 15:31:43 -03:00

13 lines
473 B
Bash

#!/bin/bash
fun_exp () {
(
for _user in $(awk -F: '$3>=1000 {print $1}' /etc/passwd | grep -v nobody); do
if [[ $(chage -l $_user |grep "Account expires" |awk -F ': ' '{print $2}') != never ]]; then
[[ $(date +%s) -gt $(date '+%s' -d"$(chage -l $_user |grep "Account expires" |awk -F ': ' '{print $2}')") ]] && userexp=$(expr $userexp + 1)
fi
[[ userexp == [0-9] ]] && userexp=0$userexp
done
echo "$userexp" > /etc/SSHPlus/Exp
) &
}
fun_exp > /dev/null 2>&1