From 800e75b3714c968d88855527632029498455623e Mon Sep 17 00:00:00 2001 From: ciesiel Date: Sat, 20 Mar 2004 11:45:56 +0000 Subject: [PATCH] - new script for new product Changed files: Zope-timerserver_remover -> 1.1 --- Zope-timerserver_remover | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 Zope-timerserver_remover diff --git a/Zope-timerserver_remover b/Zope-timerserver_remover new file mode 100755 index 0000000..a8c1033 --- /dev/null +++ b/Zope-timerserver_remover @@ -0,0 +1,58 @@ +#!/usr/bin/perl -w +# Delete substring from zope.conf between two string +# For PLD by Ciesiel + +use strict; +use locale; +use File::Copy; + +my $plik_we; +my $plik_tmp; +my $first_string; +my $sec_string; +my $usun; + + $plik_we="/etc/zope/main/zope.conf"; + $plik_tmp="./zope_pld_tmp"; + $first_string="%import timerserver"; + $sec_string=""; + $usun=0; + +open (PLIK_WEJ,"$plik_we") || die "Error - File not found: $plik_we\n"; +open (PLIK_WYJ,">$plik_tmp") || die "Error - File not found: $plik_tmp\n"; + +while () +{ + if (/^$first_string/) + { + ++$usun; + } + + if (/^$sec_string/) + { + $usun=99999.5; + } + + if ($usun>0) + { + $_=""; + } + print PLIK_WYJ; + + if ($usun==99999.5) + { + $usun=0; + } +} + +close(PLIK_WEJ); +close(PLIK_WYJ); +if ($usun==0) + { + move($plik_tmp,$plik_we); + } + else + { + unlink($plik_tmp); + print "\nNot found $first_string or $sec_string in zope.conf! - zope.conf not changed!\n"; + } -- 2.43.0