summaryrefslogtreecommitdiff
path: root/up.rb
diff options
context:
space:
mode:
Diffstat (limited to 'up.rb')
-rwxr-xr-xup.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/up.rb b/up.rb
index a9b7781..cf4d07b 100755
--- a/up.rb
+++ b/up.rb
@@ -41,7 +41,7 @@ class Host
return false
end
elsif protocol == "udp"
- system "nc -u -z -w 1 #{@hostname} #{port+1} &>/dev/null"
+ system "nc -u -z -w 1 #{@hostname} #{port} &>/dev/null"
return $?.success?
else
STDERR.write "unknown protocol '#{protocol}'\n"
@@ -54,7 +54,6 @@ class Host
url = URI site
response = Net::HTTP.get_response url
puts response.code
- #return response.kind_of? Net::HTTPSuccess
return [200, 301, 401].include? response.code.to_i
rescue
return false