pssh 忽略脚本中的读取命令

pssh 忽略脚本中的读取命令

我正在使用 pssh 在多台服务器上运行安装。在安装过程中,我希望脚本提示用户输入密码,但这并没有发生。

当我在单个服务器上运行脚本时,它会成功,但是,当我通过以下命令使用 pssh 时,它会失败。

pssh -h hostfile.txt -t 100000000 -A -l jolaoosup -P -I <./scripts

使用的脚本如下所示:

#!/bin/bash
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.tar.gz --no-check-certificate    

echo "Download complete"  
tar xzf setuptools-7.0.tar.gz
echo "File untarred"  
cd setuptools-7.0  
echo "Changed directory to setup Tool"  
python setup.py install  
echo "setup.py installed"  
cd /home/jolaoosup/  
echo "Changed into Home directory"  
wget https://bootstrap.pypa.io/get-pip.py  
echo "Pip download successful"  
**read -sp "Password: " passvar**   -> when it failed to prompt for password  
echo  
echo Thank you for your login details  
echo $passvar | dzdo -S  python get-pip.py  
echo "get-pip installed"  
echo $passvar | dzdo -S easy_install --upgrade numpy  
echo "numpy upgrade completed"  
echo $passvar | dzdo -S easy_install  --upgrade pyparsing  
echo "pyparsing upgrade completed"  
echo $passvar | dzdo -S  pip install numpy scipy matplotlib pandas statsmodels  
echo "All available packages installed"  

相关内容