forked from dragon-andy/VVIP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlock.sh
More file actions
31 lines (31 loc) · 935 Bytes
/
lock.sh
File metadata and controls
31 lines (31 loc) · 935 Bytes
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
#!/bin/bash
dateFromServer=$(curl -v --insecure --silent https://google.com/ 2>&1 | grep Date | sed -e 's/< Date: //')
biji=`date +"%Y-%m-%d" -d "$dateFromServer"`
###########- COLOR CODE -##############
NC="\e[0m"
RED="\033[0;31m"
red='\e[1;31m'
green='\e[1;32m'
NC='\e[0m'
green() { echo -e "\\033[32;1m${*}\\033[0m"; }
red() { echo -e "\\033[31;1m${*}\\033[0m"; }
echo -e "\e[32mloading...\e[0m"
clear
echo " "
username1=( cat /root/log-limit.txt);
egrep "^$username1" /etc/passwd >/dev/null
if [ $? -eq 0 ]; then
# proses mengganti passwordnya
passwd -l $username
clear
echo " "
echo " "
echo " "
echo "-----------------------------------------------"
echo -e "Username ${blue}$username${NC} successfully ${red}LOCKED!${NC}."
echo -e "Access Login to username ${blue}$username${NC} has been locked."
echo "-----------------------------------------------"
else
echo "Username not found on your server."
exit 1
fi