我想动态的关闭nginx,在面板上使用shell是可以成功关闭和打开nginx
- function module () {
- echo -e '\033[32m the scprit is success!----------> [ok]\033[0m'
- }
- case $1 in
- "start")
- module ; systemctl $1 nginx
- echo "the nginx $1"
- ;;
- "restart")
- module ; systemctl $1 nginx
- echo "the nginx $1"
- ;;
- "stop")
- module ; systemctl $1 nginx
- echo "the nginx $1"
- ;;
- *)
- echo "USAGE $0 ,please input {start|restart|stop}"
- ;;
- esac
复制代码 但是我使用springboot调用shell显示执行成功,但是在首页查看nginx还是没有被打开。
|