## nginx自动化运维功能
@app.route('/nginx',methods=['POST','GET'])
def nginx():
if request.method == 'POST':
if request.values.get('name') == '启动':
linux('systemctl start nginx')
status = 'Running'
return render_template('nginx.html',status=status)
if request.values.get('name') == '停止':
linux('systemctl stop nginx')
status = 'Stop'
return render_template('nginx.html',status=status)
if request.values.get('name') == '重启':
linux('systemctl restart nginx')
status = 'Running'
return render_template('nginx.html',status=status)
if request.method == 'GET':
linux('systemctl start nginx')
status = 'Running'
return render_template('nginx.html',status=status)
if __name__ == '__main__':
app.run(debug=True)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)