-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathfunctions.sh
executable file
·111 lines (91 loc) · 1.7 KB
/
functions.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
ALL=""
##Web methods
ALL="$ALL whatismyip"
whatismyip() {
IP=$(curl --silent whatismyip.akamai.com)
}
ALL="$ALL whatismijnip"
whatismijnip() {
IP=$(curl --silent http://whatismijnip.nl | \
cut -d " " -f 5)
}
ALL="$ALL icanhazip"
icanhazip() {
IP=$(curl --silent https://icanhazip.com/)
}
ALL="$ALL curlmyip"
curlmyip() {
IP=$(curl --silent http://curlmyip.com)
}
ALL="$ALL ident"
ident() {
IP=$(curl --silent http://ident.me/)
}
ALL="$ALL ident"
ifconfig() {
IP=$(curl --silent ifconfig.me)
}
ALL="$ALL tnx"
tnx() {
IP=$(curl --silent tnx.nl/ip)
}
ALL="$ALL ipecho"
ipecho() {
IP=$(curl --silent http://ipecho.net/plain)
}
ALL="$ALL ipapp"
ipapp() {
IP=$(curl --silent ip.appspot.com)
}
ALL="$ALL wgetip"
wgetip() {
IP=$(curl --silent wgetip.com)
}
ALL="$ALL iptyk"
iptyk() {
IP=$(curl --silent ip.tyk.nu)
}
ALL="$ALL corz"
corz() {
IP=$(curl --silent corz.org/ip)
}
ALL="$ALL whatismyipaddress"
whatismyipaddress() {
IP=$(curl --silent bot.whatismyipaddress.com)
}
ALL="$ALL ipinfo"
ipinfo() {
IP=$(curl --silent http://ipinfo.io/ip)
}
ALL="$ALL myip"
myip() {
IP=$(curl --silent http://www.myip.net/ | \
grep "<b>Your IP Address:" | \
cut -d ':' -f 4 | \
cut -d '<' -f 1)
}
ALL="$ALL shtuff"
shtuff() {
IP=$(curl --silent https://shtuff.it/myip/short/)
}
ALL="$ALL monip"
monip() {
IP=$(curl --silent http://monip.org/ | \
grep "IP :" | \
cut -d ':' -f 2 | \
cut -d '<' -f 1 )
}
##DNS method
ALL="$ALL dns"
dns() {
IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
}
##STUN method
ALL="$ALL stun"
stun() {
IP=$(stun-client -v stun.voiparound.com 2>&1 1>/dev/null | \
grep MappedAddress | \
sed -e 's/.*MappedAddress = //' -e 's/:.*//' | \
uniq)
}