monitoring: nodes reboots itself if other nodes can not reach it
diff --git a/scripts/homelab/check-ssh-login.sh b/scripts/homelab/check-ssh-login.sh
index f8241df..5c3a4a6 100755
--- a/scripts/homelab/check-ssh-login.sh
+++ b/scripts/homelab/check-ssh-login.sh
@@ -1,5 +1,16 @@
-#!/bin/sh
+#!/bin/bash
 
-ssh pcloud@192.168.0.111 "touch ~/SSH_LOGGED_IN"
-ssh pcloud@192.168.0.112 "touch ~/SSH_LOGGED_IN"
-ssh pcloud@192.168.0.113 "touch ~/SSH_LOGGED_IN"
+MY_IPS=( $(ifconfig | grep -Eo "([0-9]*\.){3}[0-9]*") )
+echo $MY_IPS
+SERVERS=(192.168.0.111 192.168.0.112 192.168.0.113 192.168.0.114 192.168.0.116)
+
+sleep $[ ( $RANDOM % 180 )  + 1 ]
+
+for IP in "${SERVERS[@]}"
+do
+    if [[ ! "${MY_IPS[*]}" =~ "$IP" ]];
+    then
+	echo $IP
+	ssh -oStrictHostKeyChecking=no "pcloud@${IP}" "touch ~/SSH_LOGGED_IN"
+    fi
+done