-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.functions
More file actions
58 lines (52 loc) · 1.45 KB
/
.functions
File metadata and controls
58 lines (52 loc) · 1.45 KB
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
function runtest() {
if [[ $# -eq 0 ]] ; then
echo 'runtest() needs the docker container name/id to run the PHPunit Tests'
echo '\n\r'
echo 'List of running containers: '
docker container ls --format "table {{.ID}}\t{{.Ports}}\t{{.Names}}"
return 0
fi
docker exec $1 php ./vendor/bin/phpunit ${@:2}
}
# rdns-local: Reverse→Forward nur über lokalen Resolver
# Usage: rdns-local <IP>
rdns-local() {
if [ -z "$1" ]; then
echo "Usage: rdns-local <IP>" >&2
return 2
fi
local ip="$1"
dig -x "$ip" +short | while read -r host; do
[ -z "$host" ] && continue
echo "PTR: $host"
dig A "$host" +short
done
}
# rdns-check: Reverse→Forward über mehrere Resolver (default, Google, Cloudflare, Quad9, OpenDNS)
# Usage: rdns-check <IP>
rdns-check() {
if [ -z "$1" ]; then
echo "Usage: rdns-check <IP>" >&2
return 2
fi
local ip="$1"
local resolvers=("default" "8.8.8.8" "1.1.1.1" "9.9.9.9" "208.67.222.222")
for r in "${resolvers[@]}"; do
if [ "$r" = "default" ]; then
echo "=== Resolver default ==="
dig -x "$ip" +short | while read -r host; do
[ -z "$host" ] && continue
echo "PTR: $host"
dig A "$host" +short
done
else
echo "=== Resolver @$r ==="
dig -x "$ip" +short @"$r" | while read -r host; do
[ -z "$host" ] && continue
echo "PTR: $host"
dig A "$host" +short @"$r"
done
fi
echo
done
}