From 63f3763e5fb81afbf5ce70b756fbc90ad1909843 Mon Sep 17 00:00:00 2001 From: James Pannacciulli Date: Sun, 12 Apr 2015 21:59:34 -0700 Subject: require server list; use '--' protection with ssh and allow as arg break --- pars.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pars.sh b/pars.sh index 7af98b8..d033db7 100644 --- a/pars.sh +++ b/pars.sh @@ -62,11 +62,19 @@ parssh () { _parssh.usage return $? ;; + -) + shift + break + ;; esac shift done [[ -z "$_parssh_servers" ]] && { + [[ -t 0 ]] && { + echo "No list of servers provided." + return 79 + } exec 9<&0 } || { exec 9<"$_parssh_servers" @@ -88,11 +96,11 @@ parssh () { } _parssh.ssh () { - ssh -no StrictHostKeyChecking=no $host "$@" + ssh -no StrictHostKeyChecking=no $host -- "$@" } _parssh.ssh_rinput () { - ssh -To StrictHostKeyChecking=no $host "$@" < "$_parssh_rinput" + ssh -To StrictHostKeyChecking=no $host -- "$@" < "$_parssh_rinput" } _parssh.host_prepend () -- cgit v1.2.3