programs.cfg
programs.cfg contains support scripts in other languages (other than the Pikt language)--for example, Perl, Python, sh, etc.
We try to manage every one of our external scripts from programs.cfg. The benefits of doing this include: having centralized backups, diffing and doing checksums against the central copy, easy access to common program components, per-system customizations, no losing track of what you have written, greater understanding of the whole, etc.
/////////////////////////////////////////////////////////////////////////////// // // PIKT programs.cfg -- support scripts in other languages // /////////////////////////////////////////////////////////////////////////////// // // (please see the comments prefacing the sample macros.cfg about // configuration file complexity and parse error debugging) // /////////////////////////////////////////////////////////////////////////////// // // this file now includes PIKT meta-comments, as well as examples of using // the #fix-#unfix directives // // for the example Perl line // // s/\n// ; // // there are three ways to get this desired result in the processed // client-side target: // // (1) install the program using the "f" piktc command-line option: // // # /pikt/bin/piktc -iv +Pf apls.pl +H vienna // // where "f" (after the "+P") says to "fix" (render immutable) the entire // script // // (2) install without the "f" option, but use backslash escapes where // needed in the server-side source script: // // s/\n\/\/ ; [ --> s/\n// ; after processing ] // // (3) install without the "f" option, and employ the #fix-#unfix directives, // examples of which are shown below // // note that you don't have to #fix selected lines only; you can #fix // entire scripts or groups of scripts, if you want // // #fix-#unfix also turns off macro substitution, the "f" command-line // option does not // // finally note that you can use #fix-#unfix in all other config files // except systems.cfg (which is always stripped of comments, and where // macro substitutions and #if-#endif directives are not allowed) // /////////////////////////////////////////////////////////////////////////////// // // programs.cfg is a natural place to use the #include directive; one // could, for example, break each of these programs into its own separate // file, then include them back into the programs.cfg file like so: // // #include <apls.pl> // #include <lpchk.pl> // #include <maxtime.exp> // [and so on...] // // see also the example use of the gethosts_perl_programs.cfg include file // below // /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // programs central to PIKT operations #include <programs/piktx_programs.cfg> #include <programs/svcstart_programs.cfg> #include <programs/maxtime_programs.cfg> /////////////////////////////////////////////////////////////////////////////// #if piktmaster # include <programs/piktdaemonchk_programs.cfg> # include <programs/downsys_programs.cfg> # include <programs/getidents_programs.cfg> # include <programs/dirs_user_programs.cfg> #endif // piktmaster /////////////////////////////////////////////////////////////////////////////// #if mailserver # include <programs/mailquota_programs.cfg> # include <programs/spoolchk_programs.cfg> # include <programs/bakmail_programs.cfg> #endif // mailserver /////////////////////////////////////////////////////////////////////////////// #if mailmanserver # include <programs/mailman_programs.cfg> #endif // mailmanserver /////////////////////////////////////////////////////////////////////////////// #if nisserver | nisclient # include <programs/nis_programs.cfg> #endif /////////////////////////////////////////////////////////////////////////////// #include <programs/admin_pikt_programs.cfg> #include <programs/apls_programs.cfg> #include <programs/trunc_programs.cfg> #include <programs/lpchk_programs.cfg> #include <programs/showdisks_programs.cfg> #include <programs/ulog_programs.cfg> #include <programs/sighup_inetd_programs.cfg> #include <programs/sighup_syslogd_programs.cfg> #include <programs/sigterm_crond_programs.cfg> /////////////////////////////////////////////////////////////////////////////// #if solaris | linux # include <programs/s90pikt_programs.cfg> #endif // solaris | linux /////////////////////////////////////////////////////////////////////////////// #if solaris # include <programs/diskdev_programs.cfg> # include <programs/autofsrestart_programs.cfg> #endif /////////////////////////////////////////////////////////////////////////////// #include <programs/adm/web_programs.cfg> #include <programs/adm/firewall_programs.cfg> /////////////////////////////////////////////////////////////////////////////// #ifdef test # include <programs/test_programs.cfg> #endifdef ///////////////////////////////////////////////////////////////////////////////
(A note about page layout: In the interest of readability, we have added artificial line wraps in many examples. Even though displayed here broken up across several screen lines, in general quoted strings, preprocessor directives, macro definitions, .log & .conf entries, and so on should all be unbroken on a single line.)
For more examples, see Samples.