]> git.pld-linux.org Git - packages/Zope-TimerService.git/blame - Zope-timerserver_remover
- new script for new product
[packages/Zope-TimerService.git] / Zope-timerserver_remover
CommitLineData
800e75b3 1#!/usr/bin/perl -w
2# Delete substring from zope.conf between two string
3# For PLD by Ciesiel
4
5use strict;
6use locale;
7use File::Copy;
8
9my $plik_we;
10my $plik_tmp;
11my $first_string;
12my $sec_string;
13my $usun;
14
15 $plik_we="/etc/zope/main/zope.conf";
16 $plik_tmp="./zope_pld_tmp";
17 $first_string="%import timerserver";
18 $sec_string="</timer-server>";
19 $usun=0;
20
21open (PLIK_WEJ,"$plik_we") || die "Error - File not found: $plik_we\n";
22open (PLIK_WYJ,">$plik_tmp") || die "Error - File not found: $plik_tmp\n";
23
24while (<PLIK_WEJ>)
25{
26 if (/^$first_string/)
27 {
28 ++$usun;
29 }
30
31 if (/^$sec_string/)
32 {
33 $usun=99999.5;
34 }
35
36 if ($usun>0)
37 {
38 $_="";
39 }
40 print PLIK_WYJ;
41
42 if ($usun==99999.5)
43 {
44 $usun=0;
45 }
46}
47
48close(PLIK_WEJ);
49close(PLIK_WYJ);
50if ($usun==0)
51 {
52 move($plik_tmp,$plik_we);
53 }
54 else
55 {
56 unlink($plik_tmp);
57 print "\nNot found $first_string or $sec_string in zope.conf! - zope.conf not changed!\n";
58 }
This page took 0.088122 seconds and 4 git commands to generate.