-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnumberbook.sh
52 lines (44 loc) · 927 Bytes
/
numberbook.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
#!/bin/bash
echo "
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ..| Number Book v1.0 |.. |
| Twitter: az7rb |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
"
Help()
{
# Display Help
echo "options:"
echo ""
echo "-h Help"
echo "-n Search namber book | Example: $0 -n 0512345678"
echo ""
}
# Request
def() {
requestsearch="$(curl -s "https://rdod.live/contacts_api/api.php?getName=true&phone=$req")"
echo $requestsearch > req
cat -n req | jq | egrep "name" | cut -d'"' -f4 | sort -u | uniq -u
rm req
echo ""
}
if [ -z $1 ]
then
Help
exit
else
req=$2
fi
while getopts "h|n|" option; do
case $option in
h) # display Help
Help
;;
n) # Search
def
;;
*) # Invalid option
Help
;;
esac
done