Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

perl mechanize

Discussion in 'General Discussion' started by mojamoi, Jan 17, 2008.

  1. mojamoi

    mojamoi Well-Known Member

    Joined:
    Jul 23, 2007
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    66
    pls craft this script to add and restore 1000 accounts on cpanel serevrs
    #!/usr/bin/perl -w

    use strict;
    use WWW::Mechanize;
    use MIME:ase64;

    my $mech = WWW::Mechanize->new( autocheck => 1 );
    my @args = (
    Authorization => "Basic " .
    MIME:ase64::encode( 'user' . ':' . 'pass' )
    );

    $mech->credentials( 'http://hosting.com:5555', 'cPanel', 'user', 'pass' );
    $mech->get( 'http://hosting.com:5555', @args );
    $mech->follow_link( text => 'Addon Domains', n=> 1 );



    this is the shell script logic i require and have it ti be used in the perl for use ::mewchanize
    for a in `seq 1 10000`; do
    /scripts/wwwacct domain$a.com user$a password
    /scripts/pkgacct user$a
    scp /home/cpmove-user$a.tar.gz user@remove.server:~
    ; done
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice