You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
526 B
29 lines
526 B
13 years ago
|
#!/bin/sh
|
||
|
#
|
||
|
# __remote_copy script to run cdist against a local chroot instead of via ssh
|
||
|
# to a remote target host.
|
||
|
#
|
||
|
# Usage:
|
||
|
# __remote_copy="/path/to/this/script /path/to/your/chroot" cdist config target-id
|
||
|
#
|
||
|
|
||
|
log() {
|
||
|
#echo "$@" | logger -t "cdist-chroot-copy"
|
||
|
:
|
||
|
}
|
||
|
|
||
|
chroot="$1"; shift
|
||
|
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 "$code"
|
||
|
|
||
|
# copy files into chroot
|
||
|
cp $code
|
||
|
|
||
|
log "-----"
|