From f864d307be95aec568a05a401784822ae21923e6 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 3 Nov 2011 22:35:06 +0100 Subject: [PATCH] +licence, +logging Signed-off-by: Steven Armstrong --- other/examples/remote/chroot/copy | 21 ++++++++++++++++++++- other/examples/remote/chroot/exec | 24 ++++++++++++++++++++++-- other/examples/remote/ssh/copy | 18 ++++++++++++++++++ other/examples/remote/ssh/exec | 18 ++++++++++++++++++ 4 files changed, 78 insertions(+), 3 deletions(-) diff --git a/other/examples/remote/chroot/copy b/other/examples/remote/chroot/copy index eb284ced..528a5faf 100755 --- a/other/examples/remote/chroot/copy +++ b/other/examples/remote/chroot/copy @@ -1,5 +1,23 @@ #!/bin/sh # +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# # __remote_copy script to run cdist against a local chroot instead of via ssh # to a remote target host. # @@ -18,8 +36,9 @@ target_host="$__target_host" # replace target_host with chroot location code="$(echo "$@" | sed "s|$target_host:|$chroot|g")" -log "$@" log "target_host: $target_host" +log "chroot: $chroot" +log "$@" log "$code" # copy files into chroot diff --git a/other/examples/remote/chroot/exec b/other/examples/remote/chroot/exec index 21efe421..19e76b0e 100755 --- a/other/examples/remote/chroot/exec +++ b/other/examples/remote/chroot/exec @@ -1,5 +1,23 @@ #!/bin/sh # +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# # __remote_exec script to run cdist against a local chroot instead of via ssh # on a remote target host. # @@ -14,14 +32,16 @@ log() { chroot="$1"; shift target_host="$1"; shift + script=$(mktemp "${chroot}/tmp/chroot-${0##*/}.XXXXXXXXXX") trap cleanup INT TERM EXIT cleanup() { [ $__cdist_debug ] || rm "$script" } -log "$script" -log "$@" +log "target_host: $target_host" +log "script: $script" +log "@: $@" echo "#!/bin/sh -l" > "$script" echo "$@" >> "$script" chmod +x "$script" diff --git a/other/examples/remote/ssh/copy b/other/examples/remote/ssh/copy index 76c0b2c8..0ecd8c52 100755 --- a/other/examples/remote/ssh/copy +++ b/other/examples/remote/ssh/copy @@ -1,5 +1,23 @@ #!/bin/sh # +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# # same as cdist default # # Usage: diff --git a/other/examples/remote/ssh/exec b/other/examples/remote/ssh/exec index 63994973..b597a47f 100755 --- a/other/examples/remote/ssh/exec +++ b/other/examples/remote/ssh/exec @@ -1,5 +1,23 @@ #!/bin/sh # +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# # same as cdist default # # Usage: