def _parse_script(list, line, line_iter):
    """
    Eliminate any bash script contained in the grub v2 configuration
    """
    ifIdx = 0
    while (True):
        line = next(line_iter)
        if line.startswith("fi"):
            if ifIdx == 0:
                return
            ifIdx -= 1
        elif line.startswith("if"):
            ifIdx += 1
def _parse_script ( list , line , line_iter ) : ifIdx = 0 while ( True ) : line = next ( line_iter ) if line . startswith ( "fi" ) : if ifIdx == 0 : return ifIdx -= 1 elif line . startswith ( "if" ) : ifIdx += 1
Eliminate any bash script contained in the grub v2 configuration