1 |
dpavlin |
1.1 |
#!/usr/local/bin/perl |
2 |
|
|
|
3 |
|
|
use Cwd; |
4 |
|
|
require "find.pl"; |
5 |
|
|
|
6 |
|
|
$fichier=($ARGV[0])||("."); |
7 |
|
|
|
8 |
|
|
$dirbase= cwd; |
9 |
|
|
$dirbase.="/"; |
10 |
|
|
|
11 |
|
|
print "NS Webmail Config File (c) 2000 NikoSoft\n\n"; |
12 |
|
|
print "Current dir: $dirbase\n"; |
13 |
|
|
|
14 |
|
|
&find($fichier); |
15 |
|
|
foreach $fich (@fichiers) { |
16 |
|
|
open(f,$fich); |
17 |
|
|
print "Configured file: $fich \n"; |
18 |
|
|
@fichsortie=(); |
19 |
|
|
while(<f>) { |
20 |
|
|
$ligne=$_; |
21 |
|
|
$ligne=~ s/foo\/bar/$dirbase/; |
22 |
|
|
push @fichsortie, $ligne; |
23 |
|
|
} |
24 |
|
|
close(f); |
25 |
|
|
open (f,">$fich"); |
26 |
|
|
print f @fichsortie; |
27 |
|
|
close(f); |
28 |
|
|
} |
29 |
|
|
|
30 |
|
|
print "\nAll files have been configured. You should now edit config.pl file and change\n"; |
31 |
|
|
print "the \$SMTPserver parameter to your SMTP server.\n"; |
32 |
|
|
|
33 |
|
|
exit; |
34 |
|
|
|
35 |
|
|
# fonction utilisée par le module de recherche |
36 |
|
|
sub wanted { |
37 |
|
|
push @fichiers,$File::Find::name; |
38 |
|
|
/^.*$/; |
39 |
|
|
} |