using sshpass image
This commit is contained in:
parent
27c990df94
commit
6d2f5aa8d0
2 changed files with 6 additions and 6 deletions
|
|
@ -2,7 +2,7 @@ version: '3'
|
|||
|
||||
services:
|
||||
client:
|
||||
image: rastasheep/ubuntu-sshd
|
||||
image: rsalian/centos-sshpass
|
||||
volumes:
|
||||
- workingdir:/workingdir
|
||||
- localkey:/local
|
||||
|
|
@ -16,7 +16,7 @@ services:
|
|||
- "/test.sh"
|
||||
piper:
|
||||
environment:
|
||||
- "SSHPIPERD_NO_CHECK_PERM=true"
|
||||
- "SSHPIPERD_WORKINGDIR_NOCHECKPERM=true"
|
||||
build: ../..
|
||||
links:
|
||||
- "host1:host1"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
apt-get update
|
||||
apt-get install -y sshpass
|
||||
#apt-get update
|
||||
#apt-get install -y sshpass
|
||||
|
||||
mkdir -p /local
|
||||
mkdir -p /workingdir/host{1,2}
|
||||
|
|
@ -28,7 +28,7 @@ while true; do
|
|||
echo $rnd > /names/host1
|
||||
t=`ssh host1@piper -p 2222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i /local/id_rsa cat /names/host1`
|
||||
|
||||
if [ $t != $rnd ];then
|
||||
if [ "$t" != "$rnd" ];then
|
||||
echo -e $casename $fail
|
||||
else
|
||||
echo -e $casename $succ
|
||||
|
|
@ -39,7 +39,7 @@ while true; do
|
|||
echo $rnd > /names/host2
|
||||
t=`sshpass -p root ssh host2@piper -p 2222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null cat /names/host2`
|
||||
|
||||
if [ $t != $rnd ];then
|
||||
if [ "$t" != "$rnd" ];then
|
||||
echo -e $casename $fail
|
||||
else
|
||||
echo -e $casename $succ
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue