From b222b79407c7ced46394db110b2c03003e0d2d02 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Feb 2011 10:04:12 +0100 Subject: [PATCH] add some help output in cdist-explorer-run for bogus situations Signed-off-by: Nico Schottelius --- bin/cdist-explorer-run | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/bin/cdist-explorer-run b/bin/cdist-explorer-run index 8ed3c791..b2d849b5 100755 --- a/bin/cdist-explorer-run +++ b/bin/cdist-explorer-run @@ -58,10 +58,22 @@ scp * "${__cdist_remote_user}@${__cdist_target_host}:${__cdist_remote_src_dir}" # Execute all explorers for explorer in *; do - # Execute explorers and save results in remote destination directory - ssh "${__cdist_remote_user}@${__cdist_target_host}" \ - "cd \"${__cdist_remote_src_dir}\" && \"./$explorer\" > \ - \"${__cdist_remote_dst_dir}/${explorer}\"" "$@" + if [ -f "$explorer" ]; then + if [ ! -x "$explorer" ]; then + echo "Explorer \"$explorer\" exists, but is not executable." + continue + fi + + # Execute explorers and save results in remote destination directory + ssh "${__cdist_remote_user}@${__cdist_target_host}" \ + "cd \"${__cdist_remote_src_dir}\" && \"./$explorer\" > \ + \"${__cdist_remote_dst_dir}/${explorer}\"" "$@" + else + if [ -e "$explorer" ]; then + echo "Explorer \"$explorer\" exists, but is not a file." + continue + fi + fi done # Copy results back to us