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
|
|
|
|
[ -d ~/opt/kickstart ] && rm -rf ~/opt/kickstart
|
|
|
|
mkdir -p ~/opt/kickstart
|
|
|
|
cd ~/opt/kickstart
|
|
|
|
tar xz
|
|
|
|
echo 'PATH=~/opt/kickstart/bin:\$PATH' >> ~/.bashrc
|
2014-03-02 23:13:57 +00:00
|
|
|
echo 'PATH=~/opt/kickstart/bin:\$PATH' >> ~/.bash_profile
|
2014-02-21 20:00:16 +00:00
|
|
|
echo 'PATH=~/opt/kickstart/bin:\$PATH' >> ~/.zshrc
|
|
|
|
CMD
|
|
|
|
)
|
|
|
|
|
|
|
|
tar chz -C `kickstart root-dir` . | ssh $target "$remote_command"
|