.NO..NO.K74apmd #### #!/usr/bin/perl -w use strict; # Script used to disable services that are not needed my @dirs = qw(rc0 rc1 rc2 rc3 rc4 rc5 rc6); my $expression = "autofs|apmd|isdn|lpd|netfs|nfs|nfslock|nscd|portmap |radvd|rstatd|rusersd|rwalld|rwhod|sendmail|ypbind|yppasswd|ypserv |ypxfrd"; my $result; my $i; for $i (@dirs){ opendir (DIR, "/etc/$i.d") or die "Can't open directory $_\n"; while (my $name = readdir(DIR)){ my $cmd1 = "/bin/mv /etc/$i.d/$name /etc/$i.d/.NO.$name" or print "/etc/$i.d/$name not found\n"; `$cmd1` if $name =~ /\b(K|S)\d{2}?$expression\b/; } closedir DIR; }