#!/usr/bin/perl # # Renew any OpenSRS registered domain # # Original source: http://www.userfriendly.com/renew.txt # More information: # http://www.opensrs.org/archives/discuss-list/0103/0567.html # http://www.opensrs.org/archives/discuss-list/0104/0239.html # http://www.opensrs.org/archives/discuss-list/0103/0608.html BEGIN { do "/path/to/your/OpenSRS.conf"; } use strict; use lib $PATH_LIB; use OpenSRS::XML_Client qw(:default); my $XML_Client; $XML_Client = new OpenSRS::XML_Client(%OPENSRS); $XML_Client->login; print "Enter the domain name: "; my $domain = ; chomp($domain); print "Enter years to renew for (1-10): "; my $no_years = ; chomp($no_years); print "Sending commmand to server....."; my $xcp_req = { action => 'renew', object => 'domain', attributes => { domain => "$domain", currentexpirationyear => "2001", period => "$no_years", auto_renew => "off", }, }; my $res = $XML_Client->send_cmd( $xcp_req ); my $response = $res->{ response_text }; print "\n\n"; if (not $res->{is_success}) { print "Renewal Failed: $response\n"; } else { print "Renewal Succeded!\n"; } $XML_Client->logout;