24 lines
477 B
Bash
Executable File
24 lines
477 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
[[ "$1" == "--sudo" ]] && prefix="sudo " && shift
|
|
[[ "$1" == "--password" ]] && shift && prefix="echo \"$1\" | sudo -S " && shift
|
|
|
|
target=$1
|
|
[ "$target" ] || echo "Please, provide an ssh target"
|
|
shift
|
|
|
|
[ "$DEBUG" ] && debug="-x"
|
|
|
|
remote_command=$(
|
|
cat <<CMD
|
|
[ -d ~/kickstart ] && rm -rf ~/kickstart
|
|
mkdir ~/kickstart
|
|
cd ~/kickstart
|
|
tar xz
|
|
$prefix bash $debug install.sh
|
|
CMD
|
|
)
|
|
|
|
kickstart compile $@
|
|
tar chz -C compile . | ssh $target "$remote_command"
|