Page 1 of 1

PPP Profile script problem ($interface var)

Posted: Mon Mar 20, 2017 1:04 am
by MayestroPW
Hello, I have a problem with PPP Profile up/down script.

Up script is working fine, but down script doesn't work.
Up:
/interface list member add interface=$interface list=LAN
Down:
/interface list member remove numbers=[find where interface=$inteface]
As you can probably, I am trying to add dynamic interface created when logged in to VPN, to interface list LAN.
As I wrote earlier, Up script is working fine, but down script not. Interesting is that the $interface var value is something like *f0000x both in up and down script. Probably this is an internal interface name. Interface stays on the list, but its name is unknown. When I remove it from console by:
/interface list member remove numbers=[find where interface=*f0000x]
It works then.

When I change down script, to remove interface by its exact name it works too.
/interface list member remove numbers=[find where interface=<pptp-userman>]
Can somebody help me with that problem?

Re: PPP Profile script problem ($interface var)

Posted: Tue Apr 18, 2017 8:36 am
by ericksetiawan
Try this set. Hope it helps.

on-up
{
:local ifaceName [:pick $interface 1 [:len $interface]];
/interface list member add interface=$interface comment=$ifaceName list=LAN;
:log warning message=($ifaceName." added");
}
on-down
{
:local ifaceName [:pick $interface 1 [:len $interface]];
/interface list member remove [find comment=$ifaceName];
:log warning message=($ifaceName." removed");
}

Re: PPP Profile script problem ($interface var)

Posted: Tue Apr 18, 2017 10:32 pm
by MayestroPW
Thank you for replay.
In 6.39rc72 they added the Interface List option to PPP Profile, so I will not need that script anymore.
*) ppp - added option to specify "interface-list" in PPP/Profile;
However, thank you.

Re: PPP Profile script problem ($interface var)

Posted: Wed Apr 19, 2017 12:38 pm
by ericksetiawan
OK, just trying to help. Maybe another point from my answer is that "comment" is very very useful.