Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
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