Community discussions

MikroTik App
 
kelvinmurithi3229
just joined
Topic Author
Posts: 6
Joined: Mon Jul 19, 2021 5:50 am

Change all users in PPPOE profile A to profile B.

Thu May 12, 2022 2:23 am

Hello,

I am trying to change all users in PPPOE profile A to profile B at once. Can you please help me with the script?
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3291
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Change all users in PPPOE profile A to profile B.

Thu May 12, 2022 8:28 am

Here you go:
{
/ppp secret
:foreach id in=[find where profile="Profile-A"] do={
	set $id profile="Profile-B"
}
}
 
sid5632
Long time Member
Long time Member
Posts: 553
Joined: Fri Feb 17, 2017 6:05 pm

Re: Change all users in PPPOE profile A to profile B.  [SOLVED]

Thu May 12, 2022 12:35 pm

Or do it in one line, like this:
/ppp secret set profile="Profile-B" [find profile="Profile-A"]
although you probably want something similar with "/interface pppoe-client" or "/interface pppoe-server", but your question was too vague to know.
 
kelvinmurithi3229
just joined
Topic Author
Posts: 6
Joined: Mon Jul 19, 2021 5:50 am

Re: Change all users in PPPOE profile A to profile B.

Thu May 12, 2022 12:53 pm

Or do it in one line, like this:
/ppp secret set profile="Profile-B" [find profile="Profile-A"]
although you probably want something similar with "/interface pppoe-client" or "/interface pppoe-server", but your question was too vague to know.
Hi, Thanks for your reply.

These are the profiles I want to change. Move all users in profile X to profile Y. (see attached screenshot)
Screenshot 2022-05-12 124801.png
You do not have the required permissions to view the files attached to this post.
 
kelvinmurithi3229
just joined
Topic Author
Posts: 6
Joined: Mon Jul 19, 2021 5:50 am

Re: Change all users in PPPOE profile A to profile B.

Thu May 12, 2022 12:55 pm

Here you go:
{
/ppp secret
:foreach id in=[find where profile="Profile-A"] do={
	set $id profile="Profile-B"
}
}
Thank you. It works. :D :D

Who is online

Users browsing this forum: No registered users and 22 guests