#!/usr/bin/perl -w use strict; $_ = `ipconfig`; /(\d+\.\d+\.\d+\.\d+)\s*$/; my (@try); print "Starting apache service with $1 as IP...\n"; open(CONF, "C:\\progra~1\\apache~1\\apache\\conf\\httpd.conf") || die +"cannot open file: $!"; @try=<CONF>; close(CONF); print "$try[256] old IP"; $try[256]="ServerName $1\n"; #UPDATE HERE print "$try[256] is IP for apache"; open(CONF, ">C:\\progra~1\\apache~1\\apache\\conf\\httpd.conf") || die + "cannot open file3: $!"; foreach (@try) { print CONF "$_"; } close CONF; system("C:\\Progra~1\\Apache~1\\Apache\\Apache.exe") || die "Can't sta +rt apache service: $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: Apache IP-Autoupdater
by jeffa (Bishop) on Dec 06, 2000 at 23:26 UTC | |
by btrott (Parson) on Dec 07, 2000 at 00:16 UTC | |
|
Re: Apache IP-Autoupdater
by KM (Priest) on Dec 06, 2000 at 23:51 UTC | |
|
Re: Apache IP-Autoupdater
by Nimster (Sexton) on Dec 07, 2000 at 01:56 UTC |