(net_ifs, ip_addrs, verbose=True, dry=False)
Set IPs of one or multiple DVB network interface(s

    Args:
        net_ifs   : List of DVB network interface names
        ip_addrs  : List of IP addresses for the dvbnet interface's subnet mask
        verbose   : Controls verbosity
        dry       : Dry run mode
Set IPs of one or multiple DVB network interface(s
Set IPs of one or multiple DVB network interface ( s
def set_ips(net_ifs, ip_addrs, verbose=True, dry=False):
    """Set IPs of one or multiple DVB network interface(s

    Args:
        net_ifs   : List of DVB network interface names
        ip_addrs  : List of IP addresses for the dvbnet interface's subnet mask
        verbose   : Controls verbosity
        dry       : Dry run mode

    """
    runner.set_dry(dry)

    if (verbose):
        util.print_header("Interface IP Address")

    if (dry):
        print("Configure a static IP address on the dvbnet interface.\n")

    # Configure static IP addresses
    if (which("netplan") is None):
        _check_debian_net_interfaces_d(dry)

    for net_if, ip_addr in zip(net_ifs, ip_addrs):
        _set_ip(net_if, ip_addr, verbose)

    # Bring up interfaces
    ifup_required = False
    if (which("netplan") is not None):
        if (dry):
            print("Finally, apply the new netplan configuration:\n")
        runner.run(["netplan", "apply"], root=True)
    elif (os.path.exists("/etc/network/interfaces.d/")):
        ifup_required = True
        # Debian approach
        if (dry):
            util.fill_print("Finally, restart the networking service and "
                            "bring up the interfaces:")
            print()
        runner.run(["systemctl", "restart", "networking"], root=True)
    elif (os.path.exists("/etc/sysconfig/network-scripts")):
        ifup_required = True
        # CentOS/Fedora/RHEL approach
        if (dry):
            print(textwrap.fill("Finally, bring up the interfaces:") + "\n")

    if (ifup_required):
        for net_if in net_ifs:
            runner.run(["ifup", net_if], root=True)
def set_ips ( net_ifs , ip_addrs , verbose = True , dry = False ) : runner . set_dry ( dry ) if ( verbose ) : util . print_header ( "Interface IP Address" ) if ( dry ) : print ( "Configure a static IP address on the dvbnet interface.\n" ) # Configure static IP addresses if ( which ( "netplan" ) is None ) : _check_debian_net_interfaces_d ( dry ) for net_if , ip_addr in zip ( net_ifs , ip_addrs ) : _set_ip ( net_if , ip_addr , verbose ) # Bring up interfaces ifup_required = False if ( which ( "netplan" ) is not None ) : if ( dry ) : print ( "Finally, apply the new netplan configuration:\n" ) runner . run ( [ "netplan" , "apply" ] , root = True ) elif ( os . path . exists ( "/etc/network/interfaces.d/" ) ) : ifup_required = True # Debian approach if ( dry ) : util . fill_print ( "Finally, restart the networking service and " "bring up the interfaces:" ) print ( ) runner . run ( [ "systemctl" , "restart" , "networking" ] , root = True ) elif ( os . path . exists ( "/etc/sysconfig/network-scripts" ) ) : ifup_required = True # CentOS/Fedora/RHEL approach if ( dry ) : print ( textwrap . fill ( "Finally, bring up the interfaces:" ) + "\n" ) if ( ifup_required ) : for net_if in net_ifs : runner . run ( [ "ifup" , net_if ] , root = True )