Skip to content

Commit

Permalink
feat: supervisor plugin and optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Jul 25, 2023
1 parent b4720a1 commit 65a4679
Show file tree
Hide file tree
Showing 11 changed files with 1,063 additions and 6 deletions.
3 changes: 1 addition & 2 deletions app/http/controllers/plugins/php74/php74_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ func (c *Php74Controller) Status(ctx http.Context) {
return
}

out := tools.ExecShell("systemctl status php-fpm-" + c.version + " | grep Active | grep -v grep | awk '{print $2}'")
status := strings.TrimSpace(out)
status := tools.ExecShell("systemctl status php-fpm-" + c.version + " | grep Active | grep -v grep | awk '{print $2}'")
if len(status) == 0 {
controllers.Error(ctx, http.StatusInternalServerError, "获取PHP-"+c.version+"运行状态失败")
return
Expand Down
3 changes: 1 addition & 2 deletions app/http/controllers/plugins/php80/php80_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ func (c *Php80Controller) Status(ctx http.Context) {
return
}

out := tools.ExecShell("systemctl status php-fpm-" + c.version + " | grep Active | grep -v grep | awk '{print $2}'")
status := strings.TrimSpace(out)
status := tools.ExecShell("systemctl status php-fpm-" + c.version + " | grep Active | grep -v grep | awk '{print $2}'")
if len(status) == 0 {
controllers.Error(ctx, http.StatusInternalServerError, "获取PHP-"+c.version+"运行状态失败")
return
Expand Down
Loading

0 comments on commit 65a4679

Please sign in to comment.