-
Notifications
You must be signed in to change notification settings - Fork 0
/
T_log.sh
executable file
·90 lines (80 loc) · 1.77 KB
/
T_log.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/data/data/com.termux/files/usr/bin/bash
#Author prince kumar
#Date 29 jan 2021
#Setup some colour pattern-----
r="\e[31;1m"
g="\e[32;1m"
y="\e[33;1m"
#Backup function.....
#Trap the user signal
trap userSignal SIGINT
trap userSignal SIGTSTP
userSignal(){
echo -e "👓\e[37;1m Invalid opretion Bro.."
superUser
}
autoUpdate(){
git pull https://github.com/princekrvert/T_log.git > /dev/null 2>&1 & sleep 0.5
echo -e "${r} checking for update.."
clear
}
#Make a function validate... the user and pass-----
#Make a function to superuser
superUser(){
echo -ne "\e[35;1m Enter the super code: "
read superCode
sSC=$(cat .Tlog/supercode)
if [[ ${superCode} == ${sSC} ]];then
rm -rf .T_log/username
rm -rf .T_log/userpass
echo -ne "🔒 ${r}Enter the new username: "
read newUserName
echo "${newUserName}" > .T_log/username
echo -ne "🔑 ${r}Enter the new userpassword: "
read newUserPass
echo "${newUserPass}" > .T_log/userpass
echo " "
echo -e "\e[37;1m 🚪 New username a password set."
exit 0
else
echo " Visit this link for pass code..."
echo "🔗 https://github.com/princekrvert/T_log/blob/main/.Tlog/supercode"
sleep 3
superUser
exit 1
exit 1
exit 1
clear
superUser
fi
}
userPass(){
if [[ -d .T_log ]];then
echo -ne "🔒 ${r}Enter the username: "
read userName
sUN=$(cat .T_log/username)
if [[ ${userName} == ${sUN} ]];then
echo -ne "🔑 ${r}Enter the password: "
read userPass
sUP=$(cat .T_log/userpass)
if [[ ${userPass} == ${sUP} ]];then
echo -e "\e[0;1m 👽 Login Sucessfully..."
else
echo " Login failed.."
exit
exit 1
exit
superUser
fi
else
echo " 🚫Invalid username or password"
superUser
exit 1
exit 0
exit 0
fi
else
echo -e "\e[36;1m 🔐 Please setup userid and pass"
fi
}
userPass