diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-11-15 10:25:30 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-11-15 10:25:30 +0100 |
commit | 9e910dec14c0f8ac3d0cdef4220046c3c570b40c (patch) | |
tree | 93726f280a37086236a21152b33e72c246f25f16 /etc/functions/put | |
parent | 8ffd07d501f4cf7798dd15ce2533289023cf5f72 (diff) |
put function: Warn if curl is not present
Diffstat (limited to 'etc/functions/put')
-rw-r--r-- | etc/functions/put | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/etc/functions/put b/etc/functions/put index 32fdc79..6626618 100644 --- a/etc/functions/put +++ b/etc/functions/put @@ -4,13 +4,18 @@ ## supports as many 'failover' hosts as an array can hold ## Usage: put <file> -autoload fdie +autoload check_com fdie warn typeset hostname typeset -a ssh_options hosts typeset target_dir server_prefix typeset file typeset -i n_hosts n_ping n_curl +if ! check_com curl; then + function curl {return 0} + warn "curl not present, won't be able to check upload success" +fi + function put_aneurysm_int { hostname='aneurysm' ssh_options=(-q) @@ -54,7 +59,7 @@ if [[ -f $1 ]] { shift hosts } } - fdie "Tried uploading to $n_hosts hosts without succes\n" \ + fdie "Tried uploading to $n_hosts hosts without success\n" \ " - $n_ping hosts are unreachable\n" \ " - $n_curl errors while uploading" } else { |