def strlist2cmd()

in pystemd/utils.py [0:0]


def strlist2cmd(strlist, cont=False):
    """
    coverts a command (an array of strings or bytes) into a cmd list usable by the Exec* family of Unit Signatures, you could do


    pystemd.run(
        cmd=...,
        extra={
            b"ExecReload": [strlist2cmd(["/bin/echo, 'there is no reaload'])]
        },
    )
    The cont param is for ignore failure and continue

    """
    cmdlist = [x2char_star(_) for _ in strlist]
    return (cmdlist[0], tuple(cmdlist), cont)