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.

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:
    16
    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