kickstart/lib/kickstart-bootstrap

19 lines
368 B
Plaintext
Raw Normal View History

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
)
2015-05-20 20:16:16 +00:00
tar chz -C "$(kickstart root-dir)" . | ssh "$target" "$remote_command"