From bc91ff224bd058127cef7fb5cf0c887842cb56f1 Mon Sep 17 00:00:00 2001 From: DarkFeather Date: Sun, 4 Feb 2018 02:37:50 -0600 Subject: [PATCH] better tests --- offload-wolfpack | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/offload-wolfpack b/offload-wolfpack index 7c397d9..b10fdfe 100755 --- a/offload-wolfpack +++ b/offload-wolfpack @@ -4,11 +4,11 @@ logfile=/var/log/wolfpack.log target="$1" dir=`sudo -u deluge deluge-console config download_location 2>/dev/null | head -n 1 | sed 's/ download_location: //'` -if [ -z "$target" ]; then +if [ -z "$target" ] || [ "$(ping -c 2 "$target" &>/dev/null; echo $?)" -ne 0 ]; then echo Usage: $0 '[target]'; exit 1 fi - +ssh $target mkdir -p /srv/yggdrasil/new_acquisition sudo -u deluge deluge-console info 2>/dev/null | ( unset name; unset id;