...
|
...
|
@@ -98,9 +98,27 @@ public class GrayNginxSwitchCtrl { |
|
|
@RequestMapping(value = "/viewGrayNginxToChangeConf")
|
|
|
@ResponseBody
|
|
|
public BaseResponse viewGrayNginxToChangeConf(String onlineOrGray) {
|
|
|
String nginxConfContent=exe(" -eview -n"+grayNginxAddress);
|
|
|
|
|
|
|
|
|
// String nginxConfContent=exe(" -eview -n"+grayNginxAddress);
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
BufferedReader input = null;
|
|
|
try {
|
|
|
input = new BufferedReader(new FileReader(new File(FILE_PATH)));
|
|
|
String line ;
|
|
|
while ((line = input.readLine()) != null) {
|
|
|
sb.append(line + "\r\n");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.error(" process exe failed!", e);
|
|
|
} finally {
|
|
|
if (input != null) {
|
|
|
try {
|
|
|
input.close();
|
|
|
} catch (IOException e) {
|
|
|
logger.error("process exe failed!", e);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
String nginxConfContent= sb.toString();
|
|
|
nginxConfContent = replaceConf(nginxConfContent,onlineOrGray," grayapigateway");
|
|
|
//" apigateway"一定要有一个空格在前面
|
|
|
nginxConfContent = replaceConf(nginxConfContent,onlineOrGray," apigateway");
|
...
|
...
|
|