extend cdist-explorer-run to accept arguments for explorers
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
2e266cfe3a
commit
51669874a7
1 changed files with 3 additions and 7 deletions
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
|
|
||||||
. cdist-config
|
. cdist-config
|
||||||
if [ $# -ne 5 ]; then
|
if [ $# -lt 5 ]; then
|
||||||
__cdist_usage "<target host> <local srcdir> <local dstdir> <remote srcdir> <remote dstdir>"
|
__cdist_usage "<target host> <local srcdir> <local dstdir> <remote srcdir> <remote dstdir> [explorer args]"
|
||||||
fi
|
fi
|
||||||
set -ue
|
set -ue
|
||||||
|
|
||||||
|
@ -36,10 +36,6 @@ __cdist_local_dst_dir="$1"; shift
|
||||||
__cdist_remote_src_dir="$1"; shift
|
__cdist_remote_src_dir="$1"; shift
|
||||||
__cdist_remote_dst_dir="$1"; shift
|
__cdist_remote_dst_dir="$1"; shift
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# New code
|
|
||||||
#
|
|
||||||
|
|
||||||
# Create remote source and destination directory
|
# Create remote source and destination directory
|
||||||
ssh "${__cdist_remote_user}@${__cdist_target_host}" \
|
ssh "${__cdist_remote_user}@${__cdist_target_host}" \
|
||||||
"mkdir -p \"${__cdist_remote_src_dir}\" \
|
"mkdir -p \"${__cdist_remote_src_dir}\" \
|
||||||
|
@ -65,7 +61,7 @@ for explorer in *; do
|
||||||
# Execute explorers and save results in remote destination directory
|
# Execute explorers and save results in remote destination directory
|
||||||
ssh "${__cdist_remote_user}@${__cdist_target_host}" \
|
ssh "${__cdist_remote_user}@${__cdist_target_host}" \
|
||||||
"cd \"${__cdist_remote_src_dir}\" && \"./$explorer\" > \
|
"cd \"${__cdist_remote_src_dir}\" && \"./$explorer\" > \
|
||||||
\"${__cdist_remote_dst_dir}/${explorer}\""
|
\"${__cdist_remote_dst_dir}/${explorer}\"" "$@"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Copy results back to us
|
# Copy results back to us
|
||||||
|
|
Loading…
Reference in a new issue