home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / c / cops_104.zip / cops_104 / perl / rc.chk < prev    next >
Text File  |  1992-03-10  |  898b  |  35 lines

  1. #!/bin/sh -- need to mention perl here to avoid recursion
  2. 'true' || eval 'exec perl -S $0 $argv:q';
  3. eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
  4. & eval 'exec /usr/local/bin/perl -S $0 $argv:q'
  5.         if 0;
  6.  
  7. #
  8. #  Usage: rc.chk
  9. #
  10. #  This checks pathnames and files inside the shell script files /etc/rc*
  11. # for writability.  The commands inside the files /etc/rc* are executed when
  12. # the machine is booted, so are of special interest.
  13. #
  14. # Made easy by chk_strings :-)
  15. #
  16. # Name: Martin Foord    Username: maf  Date: Thu Jan 17 15:11:09 EST 1991 
  17. # Email: maf%dbsm.oz.au@munnari.oz.au
  18. #
  19.  
  20. require 'chk_strings.pl';
  21.  
  22. # probably don't need to, but might want to do &'glob("/etc/rc*") instead.. ;-)
  23. @all_rc_files = ("/etc/rc*", "/etc/*rc", "/etc/rc*.d/*",
  24.          "/etc/shutdown.*d/*", "/etc/inittab");
  25.  
  26. for $file (@all_rc_files) {
  27.     while (<${file}>) {
  28.         if (-r $_) {
  29.             &chk_strings($_);
  30.             }
  31.         }
  32.     }
  33.  
  34. 1;
  35.