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!
  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

    Jul 23, 2007
    Likes Received:
    Trophy Points:
    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( '', 'cPanel', 'user', 'pass' );
    $mech->get( '', @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$ user$a password
    /scripts/pkgacct user$a
    scp /home/cpmove-user$a.tar.gz user@remove.server:~
    ; done

Share This Page