http/group/delproxy.pl
author Maciej Seroka <maciejs@symbian.org>
Wed, 28 Apr 2010 14:40:18 +0100
branchSymbian3
changeset 28 9050b340637a
parent 23 794c6106a7e2
permissions -rw-r--r--
Removed flash tag from Syborg test plan (Added automatically by ats_specialise_drop)

#!/usr/bin/perl

# Copyright (c) 2009 Symbian Foundation Ltd
# This component and the accompanying materials are made available
# under the terms of the License "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Symbian Foundation Ltd - initial contribution.
#   Maciej Seroka, maciej@symbian.org
#
# Description:
#   This is a tool for removing proxy settings from ethernetced.xml.

use Tie::File;

my $filename;
if ($ARGV[0]) {
  $filename = $ARGV[0];
 }
else { die 'Missing parameter "filename"'; }

my $LINE;
print "$filename \n";
tie (@LINE, 'Tie::File', $filename, recsep => "\n") or die ("File not found\n");
my $n = 0;
my $proxy_begin = 0;
my $proxy_end = 0;

for (@LINE) {
  if ($LINE[$n] =~ /<ProxyTable>/) {
     $proxy_begin = $n;
   }
  if ($LINE[$n] =~ /<\/ProxyTable>/) {
     $proxy_end = $n;
     last;
   }
  $n += 1;
 }

if ($proxy_end > 0) {
  splice @LINE, $proxy_begin, ($proxy_end - $proxy_begin + 1);
 }

untie @LINE;

print "OK \n";

exit 0;