diff options
author | Kim <kim.sidney@gmail.com> | 2019-07-05 22:27:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-05 22:27:58 +0200 |
commit | f69ef88616655b4d014be63d5884db1a8445dfb2 (patch) | |
tree | da3283c64f003976613435407e7943c96b807e6d | |
parent | 8c7b09c1487547df339037cfae861d78bd51a17f (diff) | |
parent | dadc594e08c41b6bc912d7348b8e762c25b8d2c4 (diff) | |
download | vyatta-op-f69ef88616655b4d014be63d5884db1a8445dfb2.tar.gz vyatta-op-f69ef88616655b4d014be63d5884db1a8445dfb2.zip |
Merge pull request #22 from runborg/current
T1499: Allow for usage of systemd interface mappings
-rwxr-xr-x | scripts/vyatta-identify-interface.pl | 2 | ||||
-rwxr-xr-x | scripts/vyatta-show-interfaces | 6 | ||||
-rw-r--r-- | templates/clear/interfaces/ethernet/node.tag/node.def | 2 | ||||
-rw-r--r-- | templates/show/dhcp/client/leases/interface/node.tag/node.def | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/scripts/vyatta-identify-interface.pl b/scripts/vyatta-identify-interface.pl index 1cfdb36..a116963 100755 --- a/scripts/vyatta-identify-interface.pl +++ b/scripts/vyatta-identify-interface.pl @@ -26,7 +26,7 @@ use strict; my $intf = shift; -if (!($intf =~ /^eth\d+/)) { +if (!($intf =~ /^(eth\d+|en[ospx])/)) { print STDERR "This command only supports Ethernet interfaces\n"; exit 1; } diff --git a/scripts/vyatta-show-interfaces b/scripts/vyatta-show-interfaces index 1b0a156..262664f 100755 --- a/scripts/vyatta-show-interfaces +++ b/scripts/vyatta-show-interfaces @@ -22,7 +22,7 @@ shopt -s extglob shopt -s nullglob declare progname=${0##*/} -declare -a full_itfs=( /sys/class/net/+(eth|vmnet|lo|tun|wan|pppoe|pppoa|adsl)* ) +declare -a full_itfs=( /sys/class/net/+(eno|ens|enp|enx|eth|vmnet|lo|tun|wan|pppoe|pppoa|adsl)* ) declare -a itfs declare _do_show=_show_itf_stats @@ -128,7 +128,7 @@ _usage () _add_itfs () { for itf ; do - if [[ $itf != +(eth|vmnet|lo|tun|wan|pppoe|pppoa|adsl)* ]] ; then + if [[ $itf != +(eno|ens|enp|enx|eth|vmnet|lo|tun|wan|pppoe|pppoa|adsl)* ]] ; then _error 2 \""$itf"\" is not an interface name\! elif [ ! -d /sys/class/net/$itf ] ; then _error 2 $itf: no such interface\! @@ -146,7 +146,7 @@ if [ $# -gt 0 ] ; then if [ $# -eq 1 ] ; then case $1 in ethernet ) - full_itfs=( /sys/class/net/+(eth|vmnet)* ) ;; + full_itfs=( /sys/class/net/+(eno|ens|enp|enx|eth|vmnet)* ) ;; loopback ) full_itfs=( /sys/class/net/lo* ) ;; tunnel ) diff --git a/templates/clear/interfaces/ethernet/node.tag/node.def b/templates/clear/interfaces/ethernet/node.tag/node.def index 17e07e1..ca48b57 100644 --- a/templates/clear/interfaces/ethernet/node.tag/node.def +++ b/templates/clear/interfaces/ethernet/node.tag/node.def @@ -1,4 +1,4 @@ help: Clear interface information for a given ethernet interface allowed: local -a array ; - array=( /sys/class/net/eth* ) ; + array=( /sys/class/net/eth* /sys/class/net/en* ) ; echo -n ${array[@]##*/} diff --git a/templates/show/dhcp/client/leases/interface/node.tag/node.def b/templates/show/dhcp/client/leases/interface/node.tag/node.def index b0120d0..a987d28 100644 --- a/templates/show/dhcp/client/leases/interface/node.tag/node.def +++ b/templates/show/dhcp/client/leases/interface/node.tag/node.def @@ -1,5 +1,5 @@ help: Show DHCP client information for interface allowed: local -a array ; - array=( /sys/class/net/eth* ) ; + array=( /sys/class/net/eth* /sys/class/net/en* ) ; echo -n ${array[@]##*/} run: /opt/vyatta/bin/vyatta-show-dhclient.pl "$6" |