From 9e910dec14c0f8ac3d0cdef4220046c3c570b40c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 15 Nov 2008 10:25:30 +0100 Subject: put function: Warn if curl is not present --- etc/functions/put | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'etc/functions/put') 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 -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 { -- cgit v1.2.3