aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Pannacciulli <jpnc@jpnc.info>2015-04-12 21:59:34 -0700
committerJames Pannacciulli <jpnc@jpnc.info>2015-04-12 22:01:33 -0700
commit63f3763e5fb81afbf5ce70b756fbc90ad1909843 (patch)
treec847586ec81d2fcd3d863da2897f78c22d8ffbb4
parent591502250a63621b729740a056369a819b6d49d9 (diff)
downloadparssh-63f3763e5fb81afbf5ce70b756fbc90ad1909843.tar.gz
parssh-63f3763e5fb81afbf5ce70b756fbc90ad1909843.tar.bz2
require server list; use '--' protection with ssh and allow as arg break
-rw-r--r--pars.sh12
1 files 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 ()