Current time: 11-30-2024, 04:59 PM Hello There, Guest! (LoginRegister)


Post Reply 
custom mod in ispcp_common_methods
Author Message
robmorin Offline
Junior Member
*

Posts: 208
Joined: Apr 2007
Reputation: 0
Post: #1
custom mod in ispcp_common_methods
I had added a few simple lines in the ispcp_common_methods file in my RC3 version that does not work in teh RC4 version, i am no code guru by far, but for some reason the below snippit from my rc3 file does not work in the rc4 version of that file, as there is also a new else statment for use if you are on BSD, i guess....

All i want to do is to run the below command to add a use on 2 other machines when a new user is added on the omega machine..

any help appreciated....

Old RC3 code that worked.....


$cmd = "$main::cfg{'CMD_USERADD'} -c virtual-user -d $homedir -g $sys_group -s /bin/false -u $sys_uid $sys_user";

### Added Rob's code below for adding remote user to remote machines ###
my $cmd_ARG = "ssh -l root peter.domain.com /usr/sbin/groupadd -g $sys_gid $sys_group";
my $cmd_ARU = "ssh -l root peter.domain.com /usr/sbin/useradd -c virtual-user -d $homedir -g $sys_group -s /bin/false -u $sys_uid $sys_user > /tmp/my-test.log $
my $cmd_ARG2 = "ssh -l root stewie.domain.com /usr/sbin/groupadd -g $sys_gid $sys_group";
my $cmd_ARU2 = "ssh -l root stewie.domain.com /usr/sbin/useradd -c virtual-user -d $homedir -g $sys_group -s /bin/false -u $sys_uid $sys_user > /tmp/my-test.lo$

### End of Rob's code ###

$rs = sys_command($cmd);

### Now actually run Rob's code to add users to remote machines ###

sys_command($cmd_ARG);
sys_command($cmd_ARU);
sys_command($cmd_ARG2);
sys_command($cmd_ARU2);

### End of Rob's code ###

return $rs if ($rs != 0);

$sql = "update domain set domain_uid = '$sys_uid', domain_gid = '$sys_gid' where domain_id = $dmn_id";

($rs, $rdata) = doSQL($sql);

return $rs if ($rs != 0);

Now o tried to add it to RC4 and it munched up stuff
Any help appreciated.
06-17-2008 02:04 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)