publish copy updates

This commit is contained in:
Wifinigel 2023-03-06 20:56:48 +00:00
parent 4548f7c5c1
commit 8a3419b536
22 changed files with 63 additions and 48 deletions

View file

@ -5,10 +5,12 @@
# --- start of function ---
:global PrintInterfaceAttrsFunc do={
# verify arg is correct type
if ([:typeof $1] != "array") do={
:error "Function argument is not an array!";
}
# extract values from array passed as arg
:local Args $1;
:local InterfaceName ($Args->"ifname");
:local InterfaceSpeed ($Args->"ifspeed");
@ -34,12 +36,13 @@
# --- end of function ---
# Let's call the function with some sample values in an array
:local Args { ifname="WAN1"; ifspeed="100Mbps";
:local Args { ifname="WAN1"; ifspeed="100Mbps"; \
ifip="192.168.99.1/24" };
$PrintInterfaceAttrsFunc $Args;
# Let's call the function with some other values in an array
:set Args { ifname="ether2-LAN"; ifspeed="1000Mbps"; ifip="172.16.1.254/24" };
:set Args { ifname="ether2-LAN"; ifspeed="1000Mbps"; \
ifip="172.16.1.254/24" };
$PrintInterfaceAttrsFunc $Args;
# Cleanup global namespace