Change font size
It is currently Tue Sep 29, 2020 11:45 am

Forum rules


As always, be well-behaved, respectful of others, and mind the topic - off topic posts may be deleted or moved to other forums.



Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Perl program to start OpenSim with correct external IP addre
PostPosted: Sat Jun 13, 2020 2:01 pm 

Joined: Mon Feb 07, 2011 4:45 pm
Posts: 11
#!/usr/bin/env perl

my $url = 'http://ifconfig.me/ip';
my $url2 = 'http://icanhazip.com';
# web sites that echoe your IP address
#
#
#
# Create a copy of your 'Regions.ini' file named
# 'Regions-template'
#
# This program will determine your external IP address
# And edit Regions-template, replacing the string
# 'SYSTEMIP' with your numeric external IP address
# and save it to a file 'Regions.ini'
#

use LWP::Simple;
my $ip_addr = get $url;
$ip_addr = get $url2 unless defined $ip_addr;;
die "Couldn't get IP Address\n" unless defined $ip_addr;
print "IP Address=",$ip_addr,"\n";
sleep 5;
open TFILE, "<Regions/Regions-template";
open RFILE, ">Regions/Regions.ini";
$/ = undef;
$rstring = <TFILE>;
close TFILE;
$rstring =~ s/SYSTEMIP/$ip_addr/g;
print RFILE $rstring;
close RFILE;
print "Start OpenSim\n";


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net