当前位置:论坛首页 > Linux面板 > 求助

springboot执行shell脚本成功后不起作用

发表在 Linux面板2022-6-30 10:10 [复制链接] 3 8266

我想动态的关闭nginx,在面板上使用shell是可以成功关闭和打开nginx
  1. function module () {
  2.          echo -e '\033[32m the scprit is success!----------> [ok]\033[0m'
  3.          }
  4. case $1 in
  5.   "start")
  6.            module ;  systemctl $1 nginx
  7.            echo "the nginx $1"
  8.            ;;
  9. "restart")
  10.           module ;  systemctl $1 nginx
  11.                      echo "the nginx $1"

  12.           ;;
  13.    "stop")
  14.            module ;  systemctl $1 nginx
  15.                       echo "the nginx $1"

  16.            ;;
  17.        *)
  18.            echo "USAGE $0 ,please input {start|restart|stop}"
  19.            ;;
  20. esac
复制代码
但是我使用springboot调用shell显示执行成功,但是在首页查看nginx还是没有被打开。

使用道具 举报 只看该作者 回复
发表于 2022-6-30 11:47:42 | 显示全部楼层
你好!检查一下执行日志
使用道具 举报 回复 支持 反对
发表于 2022-6-30 12:00:13 | 显示全部楼层
没有问题啊。

微信截图_20220630115747.png
微信截图_20220630115924.png
使用道具 举报 回复 支持 反对
发表于 2022-11-3 17:57:31 | 显示全部楼层

您好!请问您这边是否解决了问题了呢?还未解决的话这边建议重新发帖提问一下哦!感谢使用宝塔面板!
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表