diff --git a/src/main/java/net/educoder/service/CloudHostService.java b/src/main/java/net/educoder/service/CloudHostService.java index 2cf4eba..b600f7f 100644 --- a/src/main/java/net/educoder/service/CloudHostService.java +++ b/src/main/java/net/educoder/service/CloudHostService.java @@ -10,7 +10,6 @@ import net.educoder.util.JCloudUtil; import net.educoder.util.ShellUtil; import net.educoder.util.SleepUtil; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.ThreadUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; @@ -139,6 +138,7 @@ public class CloudHostService { /** * 内网穿透 + * /opt/01/02/02 frpc目录 * * @param port * @param username @@ -153,7 +153,7 @@ public class CloudHostService { // 通过浮动ip+port 连接ssh执行脚本 String command = StringUtils.join("sshpass -p ", password, " ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ", username, "@", floatingIp, " \'", - "cd /root/frp_0.44.0_linux_amd64; sudo echo -e \"", template, "\" > frpc.ini ; cat frpc.ini; nohup ./frpc >& cataline.log 2>&1 &", "\'"); + "cd /opt/01/02/02; sudo echo -e \"", template, "\" > frpc.ini ; cat frpc.ini; nohup ./frpc >& cataline.log 2>&1 &", "\'"); String uuid = RandomUtil.randomString(16); log.info("id{},配置内网穿透命令:{}", uuid, command); String execResult = ShellUtil.execute(command); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 736186e..33701b6 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -7,7 +7,7 @@ server: jcloud: username: educoder01 password: Educoder123 - imageId: 6d3b7f00-0c33-4bad-9a74-ca7d8d7e7b39 + imageId: 2cd74f05-2a57-4a69-bcd2-f7939de7ddbc frpc: host: 39.104.50.181 template: "[common]\nserver_addr = {param1}\nserver_port = 7000\n[ssh{param2}]\ntype = tcp\nlocal_ip = 127.0.0.1\nlocal_port = 22\nremote_port = {param2}"