kickstart/lib/kickstart-bootstrap

19 lines
425 B
Plaintext
Raw Permalink 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
installation_folder=$(mktemp -d -t kickstart.XXXXX)
mkdir -p $installation_folder
cd $installation_folder
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 $installation_folder/bin/kickstart /usr/local/bin/kickstart
2014-02-21 20:00:16 +00:00
CMD
)
tar chz -C "$(kickstart root-dir)" . | ssh $target "bash -c '$remote_command'"