Results 1 to 14 of 14
Thread: /scripts/postwwwacct [CPanel]
-
02-01-2009, 02:43 AM #1Junior Guru Wannabe
- Join Date
- May 2007
- Posts
- 83
Hi,
I need to run my own bash script after CPanel create account, I create postwwwacct and paste there this:
#!/usr/bin/perl
my %OPTS = @ARGV;
my $user = $OPTS{'user'};
/bin/myscript $user
But CPanel can't run this script after create account. (chmod is 755).
My script (in /bin folder) work ok, I test this - I run myscript username and this work, but CPanel can't run this... How to fix or debug this?
In additional, I really need to run this script (/bin/myscript username) after any CPanel user add domain/subdomain/parked domain, but I don't know how to do this. Please give me advice, this is very important for me.
Thank you.
-
02-01-2009, 10:57 AM #2Web Hosting Master
- Join Date
- Mar 2009
- Location
- Gods Own Country
- Posts
- 681
Are you sure cpanel is not running /scripts/postwwwacct?
Whats happens if you use this code in postwwwacct file
#!/usr/bin/perl
system("touch /tmp/testfile");
is "testfile" getting created in /tmp/?
-
02-01-2009, 11:02 AM #3Junior Guru Wannabe
- Join Date
- May 2007
- Posts
- 83
Yes, this script work ok...but cpanel can't run my script
-
02-01-2009, 11:16 AM #4Web Hosting Master
- Join Date
- Mar 2009
- Location
- Gods Own Country
- Posts
- 681
hey, use system() or exec() or backtick to execute a command in perl
-
02-01-2009, 05:54 PM #5Junior Guru Wannabe
- Join Date
- May 2007
- Posts
- 83
system("/bin/myscript $user");
This will work ok?
And very important, anybody know how to do this?
In additional, I really need to run this script (/bin/myscript username) after any CPanel user add domain/subdomain/parked domain, but I don't know how to do this. Please give me advice, this is very important for me.
-
02-01-2009, 05:56 PM #6Web Hosting Master
- Join Date
- Mar 2009
- Location
- Gods Own Country
- Posts
- 681
yea...is it working now?
-
02-01-2009, 06:29 PM #7Junior Guru Wannabe
- Join Date
- May 2007
- Posts
- 83
Yes, it works perfectly! Thank you
-
02-01-2009, 08:54 PM #8Junior Guru Wannabe
- Join Date
- May 2007
- Posts
- 83
Can anybody help me regarding my question:
In additional, I really need to run this script (/bin/myscript username) after any CPanel user add domain/subdomain/parked domain, but I don't know how to do this. Please give me advice, this is very important for me.
-
02-02-2009, 01:14 PM #9HostFX-UK Guest
Great stuff
-
02-02-2009, 01:42 PM #10Web Hosting Master
- Join Date
- Mar 2009
- Location
- Gods Own Country
- Posts
- 681
This might be tricky...theres no straight scripts that cpanel calls, i guess...
You might have use a cron or something to keep track of new addons, subdomains and parked domains...this is one way that i see...there can be other better ideas too...
-
02-02-2009, 01:46 PM #11Junior Guru Wannabe
- Join Date
- May 2007
- Posts
- 83
Yes, I use cron now...
-
02-02-2009, 02:04 PM #12HostFX-UK Guest
Yeah I would do the same.
-
06-09-2013, 06:49 AM #13New Member
- Join Date
- Jun 2013
- Posts
- 1
This is what I do
You could also add your script to cpaddonsup script that's being executed after an addon or subdomain is added.
-
06-10-2013, 06:24 PM #14Newbie
- Join Date
- May 2013
- Posts
- 7