From: Francois Fleuret Date: Sun, 28 May 2017 05:03:23 +0000 (+0200) Subject: Use the environment variable XREMOTE_HOST as default. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=1f50a9e21aef6486ab283ce785f7eff8267834a1;p=xremote.git Use the environment variable XREMOTE_HOST as default. --- 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