mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-03-03 18:00:26 +00:00
24 lines
598 B
Plaintext
24 lines
598 B
Plaintext
pssh () {
|
|
HOSTFILES="hosts ips.txt /tmp/hosts"
|
|
for HOSTFILE in $HOSTFILES; do
|
|
[ -f $HOSTFILE ] && break
|
|
done
|
|
[ -f $HOSTFILE ] || {
|
|
echo "No hostfile found (tried $HOSTFILES)"
|
|
return
|
|
}
|
|
parallel-ssh -h $HOSTFILE -l docker \
|
|
-O UserKnownHostsFile=/dev/null -O StrictHostKeyChecking=no \
|
|
-O ForwardAgent=yes \
|
|
"$@"
|
|
}
|
|
|
|
pcopykey () {
|
|
ssh-add -L | pssh --askpass --send-input \
|
|
"mkdir -p .ssh; tee .ssh/authorized_keys"
|
|
ssh-add -L | pssh --send-input \
|
|
"sudo mkdir -p /root/.ssh; sudo tee /root/.ssh/authorized_keys"
|
|
}
|
|
|
|
|