mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
mod/ipcalc: use $FormatLine
This commit is contained in:
@ -13,18 +13,19 @@
|
|||||||
:set IPCalc do={
|
:set IPCalc do={
|
||||||
:local Input [ :tostr $1 ];
|
:local Input [ :tostr $1 ];
|
||||||
|
|
||||||
|
:global FormatLine;
|
||||||
:global IPCalcReturn;
|
:global IPCalcReturn;
|
||||||
:global PrettyPrint;
|
:global PrettyPrint;
|
||||||
|
|
||||||
:local Values [ $IPCalcReturn $1 ];
|
:local Values [ $IPCalcReturn $1 ];
|
||||||
|
|
||||||
$PrettyPrint ( \
|
$PrettyPrint ( \
|
||||||
"Address: " . $Values->"address" . "\n" . \
|
[ $FormatLine "Address" ($Values->"address") ] . "\n" . \
|
||||||
"Netmask: " . $Values->"netmask" . "\n" . \
|
[ $FormatLine "Netmask" ($Values->"netmask") ] . "\n" . \
|
||||||
"Network: " . $Values->"network" . "\n" . \
|
[ $FormatLine "Network" ($Values->"network") ] . "\n" . \
|
||||||
"HostMin: " . $Values->"hostmin" . "\n" . \
|
[ $FormatLine "HostMin" ($Values->"hostmin") ] . "\n" . \
|
||||||
"HostMax: " . $Values->"hostmax" . "\n" . \
|
[ $FormatLine "HostMax" ($Values->"hostmax") ] . "\n" . \
|
||||||
"Broadcast: " . $Values->"broadcast");
|
[ $FormatLine "Broadcast" ($Values->"broadcast") ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
# calculate and return netmask, network, min host, max host and broadcast
|
# calculate and return netmask, network, min host, max host and broadcast
|
||||||
|
Reference in New Issue
Block a user