From 94f47d1cc8c12d126cb713ce5c551aa79d1a6e67 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Wed, 29 Jan 2020 13:08:05 +0100 Subject: [PATCH] Changed sendlist keyword u (update) to c (command) for clarification Starting output for sendkey improved --- seqs/ssh.sh | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/seqs/ssh.sh b/seqs/ssh.sh index dda7b00..db2a8ce 100755 --- a/seqs/ssh.sh +++ b/seqs/ssh.sh @@ -26,7 +26,13 @@ step_3() { exe ssh-keygen -b 4096 -t rsa -C "$(hostname)" -N "" -f $(realpath $toolIdentity) } -step_5_info() { echo "Send key to remote host [PORT]"; } +step_5_info() { + local userHost="" + local userPort=" [PORT]" + if [ ! -z $2 ] ; then userHost="$2"; userPort=":22"; fi + if [ ! -z $3 ] ; then userPort=":$3"; fi + echo "Send key to remote host ${userHost}$userPort" +} step_5_alias() { ALIAS="sendkey"; } step_5() { local sshPort=22 @@ -65,22 +71,22 @@ step_10() { # Parse a list to transfer files and/or execute commands on one or different hosts # # List format -# ||[STRING2]|[OPTIONS] -# COMMAND h|H|host - Change user@host:port for the following ssh/scp commands -# f|F|file - Source- and destination file path combination -# u|U|update - Execute command on the remote host +# ||[STRING2]|[OPTIONS] +# COMMAND h|H|host - Change user@host:port for the following ssh/scp commands +# f|F|file - Source- and destination file path combination +# c|C|command - Execute command on the remote host # # STRING h - user@host # f - source file path -# u - shell command string +# c - shell command string # # STRING2 h - port # f - destination file path -# u - not used +# c - not used # # OPTIONS h - not used # f - Options passed to scp -# u - not used +# c - not used # parseList() { local errorMsg="" @@ -138,7 +144,7 @@ parseList() { errorMsg="scp to $aHost failed with $?" fi ;; - u|U|update) + c|C|command) if [ -z "$aHost" ] || [ "$aHost" == "" ]; then errorMsg="No host found" saveReturn 1 @@ -175,12 +181,12 @@ h|user@host2|port2 f|/sourcedir/sourcefile|/destdir/destfile # copy source recursively f|/sourcedir/sourcefile/dir|/destdir/destfile|-r -u|/destdir/updatescript.sh +c|/destdir/updatescript.sh # host is changed and port set to default 22 for the following lines h|user@host f|/sourcedir/sourcefile|/destdir/destfile f|/sourcedir/sourcefile|/destdir/destfile -u|/destdir2/update.sh" +c|/destdir2/update.sh" -VERSION_SEQREV=6 +VERSION_SEQREV=10 . sequencer.sh