19 lines
368 B
Bash
Executable File
19 lines
368 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
target=$1
|
|
[ "$target" ] || echo "Please, provide an ssh target"
|
|
shift
|
|
|
|
remote_command=$(
|
|
cat <<CMD
|
|
target=\$(mktemp -d -t kickstart.XXXXX)
|
|
mkdir -p \$target
|
|
cd \$target
|
|
tar xz
|
|
rm -rf /usr/local/bin/kickstart
|
|
ln -s \$target/bin/kickstart /usr/local/bin/kickstart
|
|
CMD
|
|
)
|
|
|
|
tar chz -C "$(kickstart root-dir)" . | ssh "$target" "$remote_command"
|