2014-02-21 20:00:16 +00:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
target=$1
|
|
|
|
[ "$target" ] || echo "Please, provide an ssh target"
|
|
|
|
shift
|
|
|
|
|
|
|
|
remote_command=$(
|
|
|
|
cat <<CMD
|
2014-03-20 21:37:51 +00:00
|
|
|
target=\$(mktemp -d -t kickstart.XXXXX)
|
|
|
|
mkdir -p \$target
|
|
|
|
cd \$target
|
2014-02-21 20:00:16 +00:00
|
|
|
tar xz
|
2014-03-20 21:37:51 +00:00
|
|
|
rm -rf /usr/local/bin/kickstart
|
|
|
|
ln -s \$target/bin/kickstart /usr/local/bin/kickstart
|
2014-02-21 20:00:16 +00:00
|
|
|
CMD
|
|
|
|
)
|
|
|
|
|
|
|
|
tar chz -C `kickstart root-dir` . | ssh $target "$remote_command"
|