|
@@ -36,6 +36,7 @@ function testServer() {
|
|
|
\"*password\" {set timeout 500;send \"${passwd}\r\";}
|
|
|
}
|
|
|
expect eof"
|
|
|
+
|
|
|
#服务器上的相关操作
|
|
|
/usr/bin/expect << EOF
|
|
|
set time 30
|
|
@@ -77,8 +78,38 @@ EOF
|
|
|
echo "测试服务器地址:${demo_url}"
|
|
|
}
|
|
|
|
|
|
+# 删除 plugins 等目录
|
|
|
+function delPublic() {
|
|
|
+ echo "准备移除 plugins 等目录"
|
|
|
+#服务器上的相关操作
|
|
|
+/usr/bin/expect << EOF
|
|
|
+ set time 30
|
|
|
+ spawn ssh root@192.168.0.109
|
|
|
+ expect {
|
|
|
+ "*yes/no" { send "yes\r"; exp_continue }
|
|
|
+ "*password:" { send "${passwd}\r" }
|
|
|
+ }
|
|
|
+
|
|
|
+ # 进入当前项目的目录
|
|
|
+ expect "*]#"
|
|
|
+ send "cd /www/wwwroot/${file_path}\r"
|
|
|
+
|
|
|
+ # 删除 plugins 目录
|
|
|
+ expect "*]#"
|
|
|
+ send "rm -rf plugins\r"
|
|
|
+
|
|
|
+ # 退出
|
|
|
+ send "exit\r"
|
|
|
+ expect eof
|
|
|
+EOF
|
|
|
+ echo "plugins 等目录移除完成"
|
|
|
+}
|
|
|
+
|
|
|
# 上传到测试服务器
|
|
|
if [ $2 == "test" ]; then
|
|
|
+ if [ $1 == "all" ]; then
|
|
|
+ delPublic
|
|
|
+ fi
|
|
|
testServer
|
|
|
else
|
|
|
echo "编译完成"
|