Reading internal menu ID
Posted:Wed Aug 08, 2012 8:40 pm
Hi All,
I'm creating a script to reset selected PPPoE connections.
I am trying to read the internal menu ID number (ie. stuff it in
to a variable of the correct type). A "put" of the whole string
for a selected connection shows ".id" as the variable name but
I can't seem to use that. Here's my test script so far ...
#
# resets selected cpe interface once per day at 7:00am
#
{
:local cpename "mimosa";
:local ifname ("<" . "pppoe-" . $cpename . ">");
:put $cpename;
:put $ifname;
:local ifstr [/interface get [find name=$ifname]];
:local idstr [pick $ifstr 0];
:put $idstr;
}
---- output ----
mimosa
.id=*104c0
Thanks in advance!
~Reiney
I'm creating a script to reset selected PPPoE connections.
I am trying to read the internal menu ID number (ie. stuff it in
to a variable of the correct type). A "put" of the whole string
for a selected connection shows ".id" as the variable name but
I can't seem to use that. Here's my test script so far ...
#
# resets selected cpe interface once per day at 7:00am
#
{
:local cpename "mimosa";
:local ifname ("<" . "pppoe-" . $cpename . ">");
:put $cpename;
:put $ifname;
:local ifstr [/interface get [find name=$ifname]];
:local idstr [pick $ifstr 0];
:put $idstr;
}
---- output ----
mimosa
.id=*104c0
Thanks in advance!
~Reiney