Change font size
It is currently Wed Jul 15, 2020 1:59 pm

Forum rules


{L_IMAGE}
Please only post about software that directly relates to opensim, thank you.



Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Possible enhancement to OpenSim
PostPosted: Thu Jun 18, 2020 8:16 am 

Joined: Mon Feb 07, 2011 4:45 pm
Posts: 11
This perl script determines a user's external IP address and edits Regions.ini to have it. I wonder whether something like this could get incorporated into OpenSim.exe (maybe not in Perl...)



#!/usr/bin/env perl

my $url = 'http://ifconfig.me/ip';
my $url2 = 'http://icanhazip.com';
# web sites that echo your external 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