Skip to content

Commit

Permalink
重启/启动trojan添加端口开放
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Jun 30, 2021
1 parent fe17584 commit b023b12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions trojan/trojan.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func ControllMenu() {

// Restart 重启trojan
func Restart() {
util.OpenPort(core.GetConfig().LocalPort)
if err := util.ExecCommand("systemctl restart trojan"); err != nil {
fmt.Println(util.Red("重启trojan失败!"))
} else {
Expand All @@ -58,6 +59,7 @@ func Restart() {

// Start 启动trojan
func Start() {
util.OpenPort(core.GetConfig().LocalPort)
if err := util.ExecCommand("systemctl start trojan"); err != nil {
fmt.Println(util.Red("启动trojan失败!"))
} else {
Expand Down

0 comments on commit b023b12

Please sign in to comment.