summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpks <pks@pks.rocks>2022-11-22 22:34:50 +0100
committerpks <pks@pks.rocks>2022-11-22 22:34:50 +0100
commit53135b2de6aa9016efc5d425b5593a1933a0d137 (patch)
tree30afa559ccbaeb507389a848dfc74915d7da46bb
parentfc9e9c328f535579bfa014109f4919fd1804e6fa (diff)
2022-11-22HEADmain
-rw-r--r--up-www.service2
-rwxr-xr-xup.rb3
2 files changed, 2 insertions, 3 deletions
diff --git a/up-www.service b/up-www.service
index f7d00c0..4b06097 100644
--- a/up-www.service
+++ b/up-www.service
@@ -4,7 +4,7 @@ After=network.target
[Service]
User=root
-Environment=GEM_HOME=/usr/local/lib/ruby/2.5.0
+Environment=GEM_HOME=/usr/local/lib/ruby/
Environment=APP_ENV=production
ExecStart=/usr/local/src/up/up-www.rb
Restart=on-failure
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