hosts='192.168.95.2 192.168.95.1 ......'
#echo $1
module_name="pvinsight"
local_path="/root/yccn/deploy/$1"
remote_path="/data2/"
#echo $module_name , $local_path, $remote_path
echo "Will deploy [ $module_name ] to hosts [ $hosts ], Are you sure?"
read key
if [ "$key" != "Y" ] && [ "$key" != "y" ]
then
echo "Deploy has been aborted"
exit
fi
for host in $hosts
do
echo "Begin deploy $host"
scp $local_path root@$host:$remote_path
ssh root@$host "cd $remote_path;chmod +x $1;"
echo "End deploy $host"
done
阅读(972) | 评论(0) | 转发(0) |