kickstart/lib/kickstart-bootstrap

20 lines
463 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
[ -d ~/opt/kickstart ] && rm -rf ~/opt/kickstart
mkdir -p ~/opt/kickstart
cd ~/opt/kickstart
tar xz
echo 'PATH=~/opt/kickstart/bin:\$PATH' >> ~/.bashrc
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"