From c92555298d7416b612367b9f7763833eaa1c538c Mon Sep 17 00:00:00 2001 From: Ian Mancini Date: Mon, 15 Nov 2021 11:42:01 -0300 Subject: [PATCH] Add script to ping desktop PC --- ping-desktop | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 ping-desktop diff --git a/ping-desktop b/ping-desktop new file mode 100755 index 0000000..6e8477d --- /dev/null +++ b/ping-desktop @@ -0,0 +1,6 @@ +#!/bin/bash + +HOSTNAME=$(grep -A1 'desktop' ~/.ssh/config | tail -n1 | xargs | cut -d" " -f2) +nc -z -w3 "$HOSTNAME" 2424 + +[ $? == 0 ] && exit 0 || exit 1