<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">tag:
priority: 318
type: txt
help: Ethernet interface name
allowed: /opt/vyatta/sbin/vyatta-interfaces.pl --show=ethernet
val_help: &lt;ethN&gt;; Ethernet interface name
syntax:expression: pattern $VAR(@) "^eth[0-9]+$" \
		   ; "interface ethernet $VAR(@): not a valid name"

syntax:expression: exec \
    "if [ ! -d /sys/class/net/$VAR(@) ]; then \
        echo \"interface ethernet $VAR(@): does not exist\";
	exit 1; \
    fi"

begin: rm -f /tmp/speed-duplex.$VAR(@)
       if [ -d "/sys/class/net/$VAR(@)" ]; then
         # assume hw-id always exists (as orig impl did)
         s_mac="$VAR(hw-id/@)"
         if [ -n "$VAR(mac/@)" ]; then
           s_mac="$VAR(mac/@)"
         fi
         /opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(@) --set-mac $s_mac
       fi

create: ip link set "$VAR(@)" up
	/opt/vyatta/sbin/vyatta-link-detect $VAR(@) on

delete: [ -d /sys/class/net/$VAR(../@) ] || exit 0
        ip link set $VAR(@) down

end: rm -f /tmp/speed-duplex.$VAR(@)
</pre></body></html>