From 2397f20faaef24c5094b80bf751251af38ef1e1a Mon Sep 17 00:00:00 2001 From: David Vargas Date: Fri, 25 Nov 2022 14:47:56 +0000 Subject: [PATCH] [U] . --- bin/check.rb | 2 +- bin/educatic.rb | 20 +++++++++++++------- todo/cambios-en-hetzner.txt | 7 ------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/bin/check.rb b/bin/check.rb index 0abfe70..d0d0324 100755 --- a/bin/check.rb +++ b/bin/check.rb @@ -3,4 +3,4 @@ require_relative "educatic" filename = File.join(File.dirname(__FILE__), "services.yaml") -Educatic.new(filename).check_services +Educatic.new(filename).check diff --git a/bin/educatic.rb b/bin/educatic.rb index c419fd4..6a96187 100644 --- a/bin/educatic.rb +++ b/bin/educatic.rb @@ -11,22 +11,28 @@ class Educatic @services = settings["services"] end - def check_services + def check @services.each_pair do |key, value| - puts "==> #{key} [#{value['hetzner']}]" + output = [] + cmd = "host #{value['ip']}| grep #{value['hostname']}| wc -l" counter = %x[#{cmd}].to_i if counter.zero? - puts " Check this:" - puts " * hostname = #{value['hostname']}" - puts " * ip = #{value['ip']}" + output << " Check this:" + output << " * hostname = #{value['hostname']}" + output << " * ip = #{value['ip']}" end unless value['todo'].nil? - puts " TODO:" + output << " TODO:" value['todo'].each_with_index do |line, index| - puts " #{index + 1}. #{line}" + output << " #{index + 1}. #{line}" end end + + unless output.size.zero? + puts "==> #{key} [#{value['hetzner']}]" + puts output.join("\n") + end end end diff --git a/todo/cambios-en-hetzner.txt b/todo/cambios-en-hetzner.txt index 7f9d045..06b5611 100644 --- a/todo/cambios-en-hetzner.txt +++ b/todo/cambios-en-hetzner.txt @@ -2,7 +2,6 @@ TODO: 1. Se propone eliminar la MV o... 2. Cambiar dominio a -==> nextcloud [docus] ==> editorcollab [docus] TODO: 1. Se muestra la página por defecto de Apache2 @@ -11,10 +10,6 @@ TODO: 1. Se propone eliminar la MV o... 2. Cambiar a <*.txs.es> -==> jekyll-www [txs] -==> acceso-keycloak [txs] -==> correo [txs] -==> git [txs] ==> pixel [social] TODO: 1. Se propone eliminar esta MV @@ -32,7 +27,6 @@ 1. Se propone eliminar la MV o... 2. Cambiar a <*.txs.es> 3. Duda: Esto no parece ser Mastodon! -==> xmpp.txs.es [social] ==> encanarias [social] TODO: 1. Dominio antiguo @@ -45,4 +39,3 @@ ==> cryptpad [ull] TODO: 1. Había que eliminar esta MV -==> mattermost [ull]