func_userlastlogin() {
> /tmp/lastseen.txt
ncuser=()
echo “be patient … reading lastseen info from user list”;echo
readarray -t ncuser <<< “$(sudo -u apache /bin/php /var/www/html/nextcloud/occ user:list|awk ‘{print $2}’)”
y=0
for i in ${ncuser[*]}
do
user=${i%?}
lastseen="$(sudo -u apache /bin/php /var/www/html/nextcloud/occ user:lastseen $user)"
echo $lastseen >> /tmp/lastseen.txt
done
cat /tmp/lastseen.txt|sort -k 3,3
}
2 Likes