Last active
January 25, 2023 19:14
-
-
Save zunda/0dcc1001ec404eb7ca00b260a55d4c52 to your computer and use it in GitHub Desktop.
某DNSプロパイダインスパイアの金盾確認コマンド
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# usage: value-domain example.com | |
# | |
# tests if the domain is blocked by the great firewall | |
# | |
# Copyright 2022 zunda <zundan at gmail.com> | |
# | |
# Permission is granted for use, copying, modification, distribution, | |
# and distribution of modified versions of this work as long as the | |
# above copyright notice is included. | |
# | |
if [ -z "$1" ]; then | |
echo usage: value-domain example.com | |
exit 1 | |
fi | |
if dig @8.8.8.8 +timeout=1 $1 > /dev/null 2>&1; | |
then | |
if dig @123.123.123.1 +timeout=1 $1 > /dev/null 2>&1; | |
then | |
echo blocked | |
else | |
echo not blocked | |
fi | |
else | |
echo not exist | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment