def taskService(): command = request.args.get("command") if command == "stop": stopTaskDaemon() return "Shutting down task daemon..." elif command == "start": startTaskDaemon() return "Starting task daemon..." elif command == "restart": stopTaskDaemon() startTaskDaemon() return "Restarting task daemon..." elif command == "status": status = checkStatus() return status
def taskService(): command = request.args.get("command") if command == "stop": stopTaskDaemon() return 'Shutting down task daemon...' elif command == "start": startTaskDaemon() return 'Starting task daemon...' elif command == "restart": stopTaskDaemon() startTaskDaemon() return 'Restarting task daemon...' elif command == "status": status = checkStatus() return status
def taskService(): #Check if username and password in session are valid. If not, redirect to login if config.USERNAME != session.get('username') or config.PASSWORD != session.get('password'): return redirect(url_for('admincraft.login')) command = request.args.get("command") if command == "stop": stopTaskDaemon() return 'Shutting down task daemon...' elif command == "start": startTaskDaemon() return 'Starting task daemon...' elif command == "restart": stopTaskDaemon() startTaskDaemon() return 'Restarting task daemon...' elif command == "status": status = checkStatus() return status