better tests

This commit is contained in:
DarkFeather 2018-02-04 02:37:50 -06:00
parent 1fda9b2234
commit bc91ff224b

View File

@ -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;