def METHOD_NAME(db, mode, linenum):
    """Update flow control setting for a console line"""
    config_db = ValidatedConfigDBConnector(db.cfgdb)
    ctx = click.get_current_context()
    table = "CONSOLE_PORT"
    dataKey = 'flow_control'
    innerMode = "1" if mode == "enable" else "0"
    data = config_db.get_entry(table, linenum)
    if data:
        if dataKey in data and innerMode == data[dataKey]:
            # do nothing if the flow control setting is same with existing configurtion
            return
        else:
            data[dataKey] = innerMode
            try:
                config_db.mod_entry(table, linenum, data)
            except ValueError as e:
                ctx.fail("Invalid ConfigDB. Error: {}".format(e))
    else:
        ctx.fail("Trying to update console port setting, which is not present.")