site/users.sh

17 lines
502 B
Bash
Raw Permalink Normal View History

2021-07-01 01:31:17 +00:00
#!/bin/bash
echo "# user list"
2021-11-12 05:07:10 +00:00
# exclude lost+found and testuser
2021-07-01 01:31:17 +00:00
for user in $(ls /home/ -1 | grep -v \+ | grep -v testuser)
do
2022-09-01 09:28:16 +00:00
if [ "$(stat -c %G "/home/$user")" == "deleted" ];then
2023-06-13 10:23:48 +00:00
echo "<del>~${user//_/\\_}</del> ";
2022-09-01 09:28:16 +00:00
else if [ "$(stat -c %G "/home/$user")" != "banned" ];then
2023-06-13 10:16:53 +00:00
# Escape underscores (note that username is '[a-z][-0-9a-z_]{2,}')
echo "[~${user//_/\\_}](/~$user) ";
else
2023-06-13 10:23:48 +00:00
echo "~${user//_/\\_} ([banned](banned.html#$user)) ";
2022-09-01 09:28:16 +00:00
fi;fi
2021-07-01 01:31:17 +00:00
done