summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-04-21 00:42:47 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-04-21 00:42:47 +0200
commit2a4dcb4bcfb658209a68684e9a736e50f83e583c (patch)
treef8dffb9c9236aa2aaaf24bc73d1a1f4a65fcf169 /etc
parent008157b53263440a28bb283d18cc326d092e6ab4 (diff)
put: Allow put -host file
Diffstat (limited to 'etc')
-rw-r--r--etc/functions/put8
1 files changed, 6 insertions, 2 deletions
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
}