2014-02-21 20:00:16 +00:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
target=$1
|
|
|
|
[ "$target" ] || echo "Please, provide an ssh target"
|
|
|
|
shift
|
|
|
|
|
|
|
|
remote_command=$(
|
2015-09-26 03:41:58 +00:00
|
|
|
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
|
2015-09-26 03:41:58 +00:00
|
|
|
ln -s $installation_folder/bin/kickstart /usr/local/bin/kickstart
|
2014-02-21 20:00:16 +00:00
|
|
|
CMD
|
|
|
|
)
|
|
|
|
|
2015-09-26 03:52:37 +00:00
|
|
|
tar chz -C "$(kickstart root-dir)" . | ssh $target "bash -c '$remote_command'"
|