What is the script name for assignment of accounts to a reseller?

sharmaine001

Well-Known Member
Jun 23, 2006
143
0
166
In WHM, there is an area where accounts can be assigned to a reseller. It's located in Reseller Center

What is the script being used for that? Reason is i have 100 accounts to assign move from one reseller to another and I want to automate it in SSH. I can retrieve the current assignment from truedomains file but I don't know what script to use and what is the command to execute re-assignment of account to another reseller in ssh. I know cpanel has scripts located in /scripts folder.

I hope somebody can help me.
 

MattCurry

Well-Known Member
Aug 18, 2009
275
0
66
Houston, Tx
Hello,

I do understand what you mean, unfortunately this is not something that we can directly support. However, this can be done through the WHM interface. Please let me know if you have any other questions.

Thank you,
Matthew Curry
 

sharmaine001

Well-Known Member
Jun 23, 2006
143
0
166
Hello,

I do understand what you mean, unfortunately this is not something that we can directly support. However, this can be done through the WHM interface. Please let me know if you have any other questions.

Thank you,
Matthew Curry
Yes i know it can be done in WHM but since it's 100 accounts, it will tedious to search through the list and assign to the new reseller account. Im looking for a way for this to be easier if i have to do this for 100 accounts
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
The URLs in WHM that contain references to /scripts have little to no relation to the /scripts directory in the root partition.

In this case there is no command line script to change the account owner. Nor do I see an API function to accomplish this.
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
In WHM, there is an area where accounts can be assigned to a reseller. It's located in Reseller Center

What is the script being used for that? Reason is i have 100 accounts to assign move from one reseller to another and I want to automate it in SSH. I can retrieve the current assignment from truedomains file but I don't know what script to use and what is the command to execute re-assignment of account to another reseller in ssh. I know cpanel has scripts located in /scripts folder.

I hope somebody can help me.
You need to replace the "OWNER=" line in the respective account files /var/cpanel/users
 

sharmaine001

Well-Known Member
Jun 23, 2006
143
0
166
so is there no way to write a bash script that will automatically get all accounts assigned to ResellerA and then change the assignment to ResellerB?
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
so is there no way to write a bash script that will automatically get all accounts assigned to ResellerA and then change the assignment to ResellerB?
I would say you apparently didn't read my previous post! :rolleyes:

(I told you what you needed to do in the last past)

Code:
#!/bin/bash
IFS="$"

cd /var/cpanel/users

if [ $# = 2 ]; then
   replace "OWNER=${1}" "OWNER=${2}" -- /var/cpanel/users/*
else
   echo "USAGE:   ./${0} <old reseller login>  <new reseller login>"
fi
 
Last edited:

sharmaine001

Well-Known Member
Jun 23, 2006
143
0
166
I would say you apparently didn't read my previous post! :rolleyes:

(I told you what you needed to do in the last past)
Ops.. sorry I misunderstood your post.

I don't understand much of the script you posted. Do i need to change OWNER=${1} with ResellerA and OWNER=${2} with ResellerB? So its something like this:

replace "reseller1" "reseller2" -- /var/cpanel/users/*

reseller1 is the username of the old reseller
reseller2 is the username of the new reseller
 
Last edited:

bvierra

Well-Known Member
Jul 28, 2006
55
1
158
Southern California
Ops.. sorry I misunderstood your post.

I don't understand much of the script you posted. Do i need to change OWNER=${1} with ResellerA and OWNER=${2} with ResellerB? So its something like this:

replace "reseller1" "reseller2" -- /var/cpanel/users/*

reseller1 is the username of the old reseller
reseller2 is the username of the new reseller
thats a bad idea, what if somewhere else it contains reseller1 in the file.... use the script provided.
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
As bvierra tried to point out to you above, I wrote the script specifically so that only the reseller owning the account would be changed. If you remove the "OWNER=" from the replace line then you are running the replace command against the entire user file and that could be very bad as you would end up altering the reseller account details themselves or possibly matching against other places you don't want to match.

You can manually run a replace command instead of using the script but you would need to keep the same format as the script and replace ${1} with the old reseller name and ${2} with the new reseller name if you were just going to manually run your own replace command.

Frankly, the script I quick whipped up for you is a lot easier. ;)
 

sharmaine001

Well-Known Member
Jun 23, 2006
143
0
166
Hmm how about if I want that i will determine which accounts to be assigned to another reseller by package?

I notice that when I acquire accounts, the user is also "root" so I cannot base the transfer from the account name