dansgalaxy

Well-Known Member
Jan 29, 2007
91
0
156
Reading, UK
cPanel Access Level
Root Administrator
I have created a small postwwwacct script to run add Domain Keys etc automatically but it doesn't appear to be running.

the /scripts/postwwwacct file contains:
Code:
#!/usr/bin/perl
# This code automatically adds domain keys after account creation.
my %OPTS = @ARGV;
my $user = $OPTS{’user’};
/usr/local/cpanel/bin/domain_keys_installer $user
/usr/local/cpanel/bin/spf_installer $user
It's owned by root & perms are 755.

Any ideas?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
If you try to run your script in command line using /scripts/postwwwacct, it is going to fail with this error:

Code:
# /scripts/postwwwacct
Unrecognized character \xE2 at /scripts/postwwwacct line 4.
I would advise changing the script to the following, which I tested and it does work:

Code:
#!/usr/bin/perl

my %OPTS = @ARGV;
$ENV{USER} = "$OPTS{'user'}";
system q(/usr/local/cpanel/bin/domain_keys_installer $USER);
system q(/usr/local/cpanel/bin/spf_installer $USER);