The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

postkillacct $OPTS{'domain'} not work :(

Discussion in 'General Discussion' started by hekri, Mar 24, 2009.

  1. hekri

    hekri Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    149
    Likes Received:
    2
    Trophy Points:
    18
    I have /scripts/postkillacct script:

    #!/usr/bin/perl
    my %OPTS = @ARGV;
    print "domain: $OPTS{'domain'} user: $OPTS{'user'}";


    User is ok but script dont print domain :( why?
     
  2. BrooksBridges

    BrooksBridges Well-Known Member

    Joined:
    Sep 2, 2004
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    I have the same issue, and it would appear that the domain is not passed into postkillacct as it is with postwwwacct.

    From here:

    http://twiki.cpanel.net/twiki/bin/view/AllDocumentation/ScriptHooks

    /scripts/postkillacct <user> <keepdns> - Runs after account termination. (/scripts/killacct) HASH (make sure to parse as a hash because keepdns or user could change order).

    Sure wish they *would* include it, since I'm using it to add and remove domains from postini...
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You could create /scripts/prekillacct instead so you can match that user to their domain(s) via the XML API (or other means) before the account is terminated.
     
  4. BrooksBridges

    BrooksBridges Well-Known Member

    Joined:
    Sep 2, 2004
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    Actually, I did end up using prekillacct, and build a bit of script to parse out /var/cpanel/userdata/(username)/main to get the data I needed.

    The API calls ended up not being an option, since the lack of documentation made it almost impossible to understand.
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    What data did you need? I can assist you with the APIs.

    Acquiring information by other methods is not guaranteed to continue working in the future.
     

Share This Page