diff --git a/programs/rdl_ssh_touch b/programs/rdl_ssh_touch index e57471f..97e8d1c 100644 --- a/programs/rdl_ssh_touch +++ b/programs/rdl_ssh_touch @@ -14,6 +14,8 @@ try_connection() { timeout 20 ssh "$login" touch "$file" } +export -f try_connection + should_reset() { last_run=$(< /var/rdl_ssh_touch/"$login") @@ -32,6 +34,8 @@ should_reset() { fi } + + if ! rdl_prometheus try_connection; then echo Can\'t ssh "$login" touch "$file". if should_reset; then