@echo off
set user=root
set password=huansi.net
set ip=127.0.0.1
set port=1111

plink %user%@%ip% -P %port% -pw %password% "echo huansi"

echo 是否输出huansi

echo 是否输出huansi, 如果正确输出请输入y y/n:
set /p flag=
if /i %flag% == y (
echo 建立上传目录
plink %user%@%ip% -P %port% -pw %password% "mkdir -p /huansi && mkdir -p /huansi/deploy"
echo 删除服务器上的旧版镜像tar
plink %user%@%ip% -P %port% -pw %password% "rm -f /huansi/deploy/*.tar"
echo 上传镜像...
pscp -pw %password% -P %port% -r D:\HuanSi\LinuxData\upload\ %user%@%ip%:/huansi/deploy
echo 升级镜像...
plink %user%@%ip% -P %port% -pw %password% "cd /huansi/deploy && python /huansi/deploy/upgrade.py"
echo 升级完成,可以愉快的玩耍了
)^
else (echo "stop the procedure!")
pause