Function fromStdin

  • Read commands from standard input and invoke them. First failure will cause termination of ip.

    Parameters

    Returns Promise<Command<Empty>>

    Throws

    ParametersError - Throws when passed parameters are invalid.

    Throws

    CommandError - Throws when the executed command fails.

    Example

    Import module

    import { batch } from 'iproute';
    

    Executes batch commands from stdin

    await batch.fromStdin({
    stdin: [
    'address add local 127.0.1.4/32 dev lo',
    'address add local 127.0.1.5/32 dev lo',
    'address add local 127.0.1.6/32 dev lo',
    'address add local 127.0.1.7/32 dev lo'
    ].join('\n')
    });

Generated using TypeDoc