kickstart/lib/kickstart-bootstrap
2014-03-20 18:37:51 -03:00

19 lines
363 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"