36 lines
662 B
Perl
36 lines
662 B
Perl
|
#!/usr/bin/perl
|
||
|
|
||
|
|
||
|
my $urlname = shift;
|
||
|
my $url = shift;
|
||
|
|
||
|
open(MENUFILE, "/usr/local/biotools/GDE/CORE/.GDEmenus")
|
||
|
or die "cannot open menu file, sorry\n";
|
||
|
$newFileName = "/usr/local/biotools/GDE/CORE/.GDEmenusNew";
|
||
|
open(NEWFILE, ">$newFileName");
|
||
|
READLOOP:
|
||
|
while (<MENUFILE>){
|
||
|
print NEWFILE;
|
||
|
if (/^menu:On-Line/){
|
||
|
print "FOUND\n";
|
||
|
print NEWFILE "item:$urlname\n";
|
||
|
print NEWFILE "itemmethod:netscape $url &\n";
|
||
|
last READLOOP;
|
||
|
|
||
|
}
|
||
|
}
|
||
|
while (<MENUFILE>){
|
||
|
print NEWFILE;
|
||
|
}
|
||
|
close(NEWFILE);
|
||
|
close(MENUFILE);
|
||
|
|
||
|
system("cp $newFileName /usr/local/biotools/GDE/CORE/.GDEmenus")
|
||
|
or die "cannot replace old menu file\n";
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|