-
Notifications
You must be signed in to change notification settings - Fork 0
/
Reader.sh
executable file
·49 lines (48 loc) · 2.05 KB
/
Reader.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
#!/bin/bash
declare +i password_input=""
declare pass="123"
while true
do
if read line
then
if [[ $line != " " ]]
then
sizeLine=`expr length "$line"`
if [[ $sizeLine == 1 ]]
then
if [[ $line != "*" ]]
then
password_input=$password_input$line;
echo $password_input;
date +"%D %T"
else
if [[ $password_input == $pass ]]
then
echo "Access granted via Password"
echo "Access granted via Password" $password_input $(date +"%D %T") > file
date +"%D %T"
break
else
echo "Access denied via Password"
echo "Access denied via Password" $password_input $(date +"%D %T") > file
date +"%D %T"
break
fi
fi
else
if [[ $line == "91 2d 0c 26" ]]
then
echo "Access granted via ID" $line $(date +"%D %T")
echo "Access granted via ID" $line $(date +"%D %T") > file
date +"%D %T"
break
else
echo "Access denied via ID" $line $(date +"%D %T")
echo "Access denied via ID" $line $(date +"%D %T") > file
date +"%D %T"
break
fi
fi
fi
fi
done