kickstart/lib/kickstart-bootstrap
2015-09-26 00:52:37 -03:00

19 lines
425 B
Bash
Executable File

#!/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
tar xz
rm -rf /usr/local/bin/kickstart
ln -s $installation_folder/bin/kickstart /usr/local/bin/kickstart
CMD
)
tar chz -C "$(kickstart root-dir)" . | ssh $target "bash -c '$remote_command'"