示例#1
0
def get_whirlpool_status():
    # Find whirlpool status
    whirlpool_status = "Disabled"
    whirlpool_status_color = "gray"
    whirlpool_initialized = os.path.isfile(
        "/mnt/hdd/mynode/whirlpool/whirlpool-cli-config.properties")

    if is_testnet_enabled():
        whirlpool_status = "Requires Mainnet"
        whirlpool_status_color = "gray"
        return whirlpool_status, whirlpool_status_color, whirlpool_initialized

    if is_whirlpool_enabled():
        status_code = get_service_status_code("whirlpool")
        if status_code != 0:
            whirlpool_status = "Inactive"
            whirlpool_status_color = "red"
        else:
            if whirlpool_initialized:
                whirlpool_status = "Running"
                whirlpool_status_color = "green"
            else:
                whirlpool_status = "Waiting for initialization..."
                whirlpool_status_color = "yellow"
    return whirlpool_status, whirlpool_status_color, whirlpool_initialized
示例#2
0
def whirlpool_page():
    check_logged_in()

    whirlpool_api_key = 'Not found'
    try:
        whirlpool_api_key = subprocess.check_output(
            "cat /mnt/hdd/mynode/whirlpool/whirlpool-cli-config* | grep -i cli.Apikey= | cut -c 12-",
            shell=True)
    except:
        whirlpool_api_key = 'error'

    whirlpool_status, whirlpool_status_color, whirlpool_initialized = get_whirlpool_status(
    )

    # Load page
    templateData = {
        "title": "myNode Whirlpool",
        "ui_settings": read_ui_settings(),
        "whirlpool_status": whirlpool_status,
        "whirlpool_status_color": whirlpool_status_color,
        "whirlpool_enabled": is_whirlpool_enabled(),
        "whirlpool_initialized": whirlpool_initialized,
        "whirlpool_api_key": whirlpool_api_key
    }
    return render_template('whirlpool.html', **templateData)
示例#3
0
def get_whirlpool_status():
    # Find whirlpool status
    whirlpool_status = "Disabled"
    whirlpool_status_color = "gray"
    whirlpool_initialized = os.path.isfile(
        "/opt/mynode/whirlpool/whirlpool-cli-config.properties")
    if is_whirlpool_enabled():
        status = os.system("systemctl status whirlpool --no-pager")
        if status != 0:
            whirlpool_status = "Inactive"
            whirlpool_status_color = "red"
        else:
            if whirlpool_initialized:
                whirlpool_status = "Running"
                whirlpool_status_color = "green"
            else:
                whirlpool_status = "Waiting for initialization."
                whirlpool_status_color = "yellow"
    return whirlpool_status, whirlpool_status_color, whirlpool_initialized