Updating Radius service address

Hi

I’ve got a problem were I cannot get a service entry in ‘/radius’ removed.

What I’m trying to do, is to run a simple Netwatcher and “replacement” script.
The Netwatcher thing works, so I"m gonna skip over it.
When Netwatcher’s Down-Script is triggered, it should run this:

/radius remove 0 (Assuming there’s only one entry)
/radius add service=ppp address=[:resolve my.fqdn.com] secret=MySecret
(And then proceed to replace the Netwatch entries with the new IP as well.)

Now these two commands, when entered in Console, works.
Even when I enter it as " :put [/radius remove 0] " - that works as well, in Console.
When attempting both formats in a script,
and manually running the script - Nothing. No effect.

In my debugging attempts I’ve created the following script:
:global wanip1
:set wanip1 ([:resolve my.fqdn.com])
:log info “$wanip1”

Now that part works. And my log shows the correct IP.

I’ve tried the following, appended below those lines on the script:

Attempt 1.) /radius remove 0
Attempt 2.) :put [/radius remove 0]
Attempt 3.) :do {/radius remove 0}

I’ve tried a million variations, but just cannot get it to remove that radius service entry.
As I said, from Console, my variations work. From script - No effect.

I’m becoming desperate.
Help!

-Krige

I’ve solved the problem, for anyone’s reference:

When using the “/radius remove 0” command,
there must first be a “0” entry to begin with.
Of course, there is an entry in the list.
But these entries are not assigned numerical index values
until you execute the Print command. But script didn’t want to do that for some reason.

Here is the code that did the trick though:
/radius remove [/radius find service=hotspot,ppp]

So many hours for so little code.
I just need a single radius server entry there, for both Hotspot and PPP authentication,
so it’s fine if it removes all, or in this case, the only entry for that service.
The very next line then proceeds to make a new entry with a freshly resolved IP.
Refer to previous post for “/radius add” line.

So, this, coupled with a Netwatcher, will check if my Dynamic IP may have changed.
If it did, it’ll remove the previous Radius entry, and put a new one in.
False positives don’t really matter - If one turns up, it’ll simply replace the entry anyway.
No harm done.

Cheers.
-Krige