def check_last_line()

in floresv1/scripts/utils.py [0:0]


def check_last_line(filepath, s, is_exact=False):
    if not os.path.exists(filepath):
        return False

    last_line = check_output(f'tail -n 1 {filepath}', shell=True).decode('utf-8').strip()
    return (s == last_line) if is_exact else (s in last_line)