Community discussions

 
ros44
newbie
Topic Author
Posts: 37
Joined: Sun Feb 25, 2018 2:05 am
Location: Sofia, Bulgaria

In /ppp profile on-up script the $interface variable is with small letters

Sat Sep 01, 2018 2:59 pm

Should this be reported as a bug:

The $interface variable in /ppp profile on-up|on-down scripts has values like this:
*f00001, *f00002, *f00003 ... *f00019, *f0001a, *f0001b (Small Letters)

If an interface with one of the interface ids from above is added in an interface list and I print the members of the list I get this:
[admin@MyRouter] > /interface list member print 
Flags: X - disabled, D - dynamic 
 #   LIST     INTERFACE
 1   CUSTOM_LIST     *F00001
 2   CUSTOM_LIST     *F0001B
* My focus is on ppp interfaces that are already down, that is why the members are displayed with their interface ids, not with their names.

Here the interface names are with Capital Letters and above are with small letters. This is causing me problems in some scripts. It would be better if the names are written in the exact same way everywhere in ROS. Should this be reported as a bug?
Last edited by ros44 on Mon Sep 03, 2018 4:02 am, edited 3 times in total.
Every moment something magical is happening!
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 217
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: In /ppp profile on-up script the $interface variable is with small letters

Sat Sep 01, 2018 3:40 pm

it's not a bug
$interface : will gives youe id of interface not the name of interface
if you want get interface name?, use this below
[/interface get $interface name];
 
ros44
newbie
Topic Author
Posts: 37
Joined: Sun Feb 25, 2018 2:05 am
Location: Sofia, Bulgaria

Re: In /ppp profile on-up script the $interface variable is with small letters

Sun Sep 02, 2018 12:15 am

The code you offered me I am already using it.

The $interface variable (when used in ppp-up or ppp-down script) returns the interface id starting with small letter -> *f00001
But when I print an interface lists members then the interface ids are shown starting with capital letter -> *F00001

To me this is inconsistent naming convention inside ROS and is causing me problems in some scripts.
Every moment something magical is happening!
 
ros44
newbie
Topic Author
Posts: 37
Joined: Sun Feb 25, 2018 2:05 am
Location: Sofia, Bulgaria

Re: In /ppp profile on-up script the $interface variable is with small letters  [SOLVED]

Thu Sep 06, 2018 11:04 am

It turns out that the difference in the naming (small, capital letters) is known thing. In order for ppp on-down script to work well the support offered me this idea:
toid $interface

I tested it and works great. I would prefer not to explain it because I have only an assumption how it works. For me this solved all my problems.
Every moment something magical is happening!

Who is online

Users browsing this forum: No registered users and 9 guests