mirror of
https://github.com/nextcloud/vm.git
synced 2025-10-26 11:27:32 +00:00
test two methods for port checking (#2344)
This commit is contained in:
parent
578ff82672
commit
c43864e47f
8
lib.sh
8
lib.sh
@ -964,14 +964,20 @@ cleanup_open_port() {
|
||||
|
||||
# Check if port is open # check_open_port 443 domain.example.com
|
||||
check_open_port() {
|
||||
print_text_in_color "$ICyan" "Checking if port ${1} is open with https://www.networkappers.com/tools/open-port-checker..."
|
||||
print_text_in_color "$ICyan" "Checking if port ${1} is open..."
|
||||
install_if_not curl
|
||||
# WAN Address
|
||||
if check_command curl -s -H 'Cache-Control: no-cache' -H 'Referer: https://www.networkappers.com/tools/open-port-checker' "https://networkappers.com/api/port.php?ip=${WANIP4}&port=${1}" | grep -q "open"
|
||||
then
|
||||
print_text_in_color "$IGreen" "Port ${1} is open on ${WANIP4}!"
|
||||
elif check_command curl -s -H 'Cache-Control: no-cache' -H 'Referer: https://please-do-not-be-so-greedy-with-resources.now' 'https://ports.yougetsignal.com/check-port.php' --data "remoteAddress=${WANIP4}&portNumber=${1}" | grep -q "open"
|
||||
then
|
||||
print_text_in_color "$IGreen" "Port ${1} is open on ${WANIP4}!"
|
||||
# Domain name
|
||||
elif check_command curl -s -H 'Cache-Control: no-cache' -H 'Referer: https://www.networkappers.com/tools/open-port-checker' "https://www.networkappers.com/api/port.php?ip=${2}&port=${1}" | grep -q "open"
|
||||
then
|
||||
print_text_in_color "$IGreen" "Port ${1} is open on ${2}!"
|
||||
elif check_command curl -s -H 'Cache-Control: no-cache' -H 'Referer: https://please-do-not-be-so-greedy-with-resources.now' 'https://ports.yougetsignal.com/check-port.php' --data "remoteAddress=${2}&portNumber=${1}" | grep -q "open"
|
||||
then
|
||||
print_text_in_color "$IGreen" "Port ${1} is open on ${2}!"
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user