-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathuser-list.sh
More file actions
34 lines (34 loc) · 1.36 KB
/
user-list.sh
File metadata and controls
34 lines (34 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
clear
echo -e " "
echo -e "\e[94m ::::::::: :::::::::: ::::::::: ::::::::::: "
echo -e "\e[94m :+: :+: :+: :+: :+: :+: :+: "
echo -e "\e[94m +:+ +:+ +:+ +:+ +:+ +:+ "
echo -e "\e[94m +#+ +:+ +#++:++# +#++:++#+ +#+ "
echo -e "\e[94m +#+ +#+ +#+ +#+ +#+ +#+ "
echo -e "\e[94m #+# #+# #+# #+# #+# #+# "
echo -e "\e[94m ######### ########## ######### ### "
echo -e "\e[94m Deb7AutoScriptVPS by Shigeno "
echo -e "\e[0m "
echo -e ""
echo -e ""
echo -e ""
echo "-------------------------------"
echo "USERNAME EXP DATE "
echo "-------------------------------"
while read expired
do
AKUN="$(echo $expired | cut -d: -f1)"
ID="$(echo $expired | grep -v nobody | cut -d: -f3)"
exp="$(chage -l $AKUN | grep "Account expires" | awk -F": " '{print $2}')"
if [[ $ID -ge 1000 ]]; then
printf "%-17s %2s\n" "$AKUN" "$exp"
fi
done < /etc/passwd
JUMLAH="$(awk -F: '$3 >= 1000 && $1 != "nobody" {print $1}' /etc/passwd | wc -l)"
echo "-------------------------------"
echo "Number of Accounts : $JUMLAH user"
echo "-------------------------------"
echo -e ""
echo -e ""
echo -e ""