Page 1 of 1

script get pppoe name to system identity

Posted: Mon Oct 31, 2016 9:02 pm
by atillaeyice
im trying to make script to get pppoe user name for an example "user1"@net to system identity automaticly so i want the part before @ to be taken is this possible to make ?

:local rescontent
:interface pppoe-client print file=ppoeusr.txt
:local fileContents [/file get [/file find name=ppoeusr.txt] contents];
:local variableName "user";
:local start [:find ($variableName . "=") $fileContents];
:set start ($start + [:len $variableName] + 1);
:local end [:find $fileContents " " $start];
:local value [:pick $fileContents $start $end];
:put ("The value of '$variableName' is: " . $value);
:system identity set name=$value


i tried this but than id doesnt get correct values

Re: script get pppoe name to system identity

Posted: Tue Nov 01, 2016 10:36 am
by atillaeyice
any ideas what i been doing wrong