From 2a4dcb4bcfb658209a68684e9a736e50f83e583c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 21 Apr 2011 00:42:47 +0200 Subject: put: Allow put -host file --- etc/functions/put | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'etc/functions/put') diff --git a/etc/functions/put b/etc/functions/put index 91c86ef..45662fc 100644 --- a/etc/functions/put +++ b/etc/functions/put @@ -47,7 +47,11 @@ while [[ ${1} == -* ]] { case ${1} in -|--) shift; break ;; *) - (( $(eval echo '$#'hosts_${1#-}) )) && eval hosts=\(\$hosts_${1#-}\) + if [[ -n ${functions[put_${1#-}]} ]]; then + hosts=(${1#-}) + else + (( $(eval echo '$#'hosts_${1#-}) )) && eval hosts=\(\$hosts_${1#-}\) + fi ;; esac shift @@ -71,7 +75,7 @@ while (( ${#hosts} )) { ping -c 1 ${hostname} &> /dev/null || ping6 -c 1 ${hostname} &> /dev/null if (( ? == 0 )) { - if (( max_size > 0 && $(zstat +size ${file}) > max_size )) { + if (( max_size > 0 && $(zstat +size ${file}) > max_size && ${#hosts} > 1 )) { shift hosts continue } -- cgit v1.2.3