From 1f50a9e21aef6486ab283ce785f7eff8267834a1 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Sun, 28 May 2017 07:03:23 +0200 Subject: [PATCH] Use the environment variable XREMOTE_HOST as default. --- xremote.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xremote.sh b/xremote.sh index 9b753e0..ecc1473 100755 --- a/xremote.sh +++ b/xremote.sh @@ -54,7 +54,10 @@ xremote.sh @XREMOTE_GET: *.dat @XREMOTE_PRE: ln -s /home/fleuret/data/pytorch ./data - Contact for comments. + If no argument is provided to @XREMOTE_HOST, the environment + variable $XREMOTE_HOST is used instead + + Contact for comments. EOF return 0 @@ -103,8 +106,9 @@ do HOST) [[ "${REMOTE_DIR}" ]] && (exit "Remote host already defined!" >&2 && exit 1) - cleanup_remote_tmp - REMOTE_HOST=${value} + REMOTE_HOST="${value}" + [[ "${REMOTE_HOST}" ]] || REMOTE_HOST="${XREMOTE_HOST}" + [[ "${REMOTE_HOST}" ]] || (echo "No remote host specified." >&2 && exit 1) REMOTE_DIR="$(ssh