-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcfg2html-linux
2804 lines (2357 loc) · 114 KB
/
cfg2html-linux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
# @(#) $Id: cfg2html-linux,v 2.99 2015/04/06 08:45:15 ralph Exp $
# -----------------------------------------------------------------------------------------
# (c) 1997-2015 by Ralph Roth -*- http://rose.rult.at -*-
# If you change this script, please mark your changes with for example
# ## <username> and send your diffs from the actual version to my email
# address: cfg2html*hotmail.com -- details see in the documentation
#
# PLEASE DO NOT ENHANCE THIS VERSION OF CFG2HTML, ENHANCE THE 6.xx VERSION INSTEAD!
#
#
# 2014-01-22, B.Lake, Allegro Consultants: changes for 2.78a include...
# 1) add a test for AWS Linux;
# 2) add BoldText function to clean up the code a bit;
# 3) enhance the CFG_CRON paragraph...
# a) set usercron correctly for $AWS;
# b) report on anacron scripts (cron.hourly, cron.daily, cron.weekly and
# cron.monthly) for both $AWS and $REDHAT.
CFGSH=$_
# unset "-set -vx" for debugging purpose, after the exec 2> statement all debug information will go the errorlog file (*.err)
#set -vx
#*vim:numbers:ruler
# ---------------------------------------------------------------------------
# __ ____ _ _ _ _ _
# ___ / _| __ _|___ \| |__ | |_ _ __ ___ | | | (_)_ __ _ ___ __
# / __| |_ / _` | __) | '_ \| __| '_ ` _ \| |_____| | | '_ \| | | \ \/ /
# | (__| _| (_| |/ __/| | | | |_| | | | | | |_____| | | | | | |_| |> <
# \___|_| \__, |_____|_| |_|\__|_| |_| |_|_| |_|_|_| |_|\__,_/_/\_\
# |___/
# HP Proliant Edition script
#
# ---------------------------------------------------------------------------
## /usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
PATH=$PATH:/sbin:/bin:/usr/sbin:/opt/omni/bin:/opt/omni/sbin ## this is a fix for wrong su root (instead for su - root)
VER=$(echo "$Id: cfg2html-linux,v 2.99 2015/04/06 08:45:15 ralph Exp $"|awk '{print $3"-"$4;}')
if [ -z "$VER" ] # no awk, e.g. my Linux router // OpenWRT
then
VER="$Revision: 2.99 $";
fi;
VERSION="cfg2html-linux version $VER " # this a common stream so we do not need the "Proliant stuff"
# Must be started under BASH - this needs reworking!
# if [ "$CFGSH" != "/bin/bash" ]
# then
# echo "WARNING!"
# echo "This script should be executed with the Bash Shell, not with $CFGSH"
# echo "Hint: Use ./$0 NOT sh $0"
# fi
#
# use "no" to disable a collection
#
CFG_ALTIRISAGENTFILES="yes" # Added by jeroen kleen HP ISS CC Engineer
CFG_APPLICATIONS="yes"
CFG_CRON="yes"
CFG_ENHANCEMENTS="yes"
CFG_FILESYS="yes"
CFG_HARDWARE="yes"
CFG_KERNEL="yes"
CFG_LVM="yes"
CFG_NETWORK="yes" # <-- Network security, collecting tcpd and ip filter settings
CFG_SOFTWARE="yes"
CFG_STINLINE="yes"
CFG_SYSTEM="yes"
CFG_PLUGINS="no"
CFG_HPPROLIANTSERVER="no"
## Jeroen Kleen HP ISS GCC added to detect HP Proliant Server at beginning.
DMIDECODE=$(which dmidecode 2>/dev/null)
if [ -x "$DMIDECODE" ]
then
echo
# if [[ "$($DMIDECODE | grep "Product Name")" =~ ProLiant ]] ## regex works here? rr, no according to 2.21 bug reports! # 28.11.2011, 13:17 modified by Ralph Roth #* rar *#
if [ $($DMIDECODE | grep "Product Name" | grep -c ProLiant) -gt 0 ]
then
CFG_HPPROLIANTSERVER="yes"
echo "** HP Proliant Server detected; executing with HP Proliant Server logs **"
else
CFG_HPPROLIANTSERVER="no"
# if [[ "$($DMIDECODE | grep "Vendor")" =~ HP ]] ## regex works here? rr // Vendor: // Vendor Syndrome
# if [[ "$($DMIDECODE | grep "Vendor" | cut -d":" -f2)" = HP ]]
if [ $($DMIDECODE | grep "Vendor" | grep -c HP) -gt 0 ]
then
echo "* HP server detected but no Proliant Server; to enable Proliant logs manually use -p argument"
fi
fi
fi
if [ "$OUTDIR" = "" ] ; then
OUTDIR="."
fi
#
#
usage() {
echo "WARNING, use this script AT YOUR OWN RISK"
echo
echo " Usage: `basename $0` [OPTIONS]"
echo " creates a HTML and plain ASCII host documentation"
echo
echo " -o set directory to write or use the environment"
echo " variable OUTDIR=\"/path/to/dir\" (directory must exist)"
echo " -v output version information and exit"
echo " -h display this help and exit"
echo ""
echo " -0 append the current date+time to the output files (D-M-Y-hhmm)"
echo " -1 append the current date to the output files (Day-Month-Year)"
echo " -2 arg like option -1, you can use date +modifier, e.g. -2%d%m"
echo " DO NOT use spaces for the filename, e.g. -2%c"
echo ""
echo " use the following options to disable / enable collections:"
echo ""
echo " -s disable: System"
echo " -c disable: Cron"
echo " -S disable: Software"
echo " -f disable: Filesystem"
echo " -l disable: LVM"
echo " -L disable: Screen tips inline"
echo " -k disable: Kernel/Libraries"
echo " -e disable: Enhancements"
echo " -n disable: Network"
echo " -a disable: Applications"
echo " -H disable: Hardware"
echo " -p enable: HP Proliant Server log files and settings" # Added by jeroen kleen HP ISS CC Engineer
echo " -A disable: Altiris ADL agent log files and settings" # Added by jeroen kleen HP ISS CC Engineer
echo " -P enable: cfg2html plugin architecture" # anaumann 2009/07/10
#echo
}
#
# getopt
#
#
#NO_ARGS=0
#if [ $# -eq "$NO_ARGS" ] # Script invoked with no command line args?
#then
# usage
# exit 1 # Exit and explain usage, if no argument(s) given.
#fi
while getopts ":o:shcSflkenaHLvhpPA:210" Option ## backported -2 -1 -0 options from cfg2html 6.0.1 - # changed 20130709 by Ralph Roth
do
case $Option in
o ) OUTDIR=$OPTARG;;
v ) echo $VERSION"// "$(uname -mrs); exit 0;; ## add uname output, see YG MSG 790 ##
h ) echo $VERSION; usage; exit 0;;
s ) CFG_SYSTEM="no";;
c ) CFG_CRON="no";;
S ) CFG_SOFTWARE="no";;
f ) CFG_FILESYS="no";;
l ) CFG_LVM="no";;
k ) CFG_KERNEL="no";;
e ) CFG_ENHANCEMENTS="no";;
n ) CFG_NETWORK="no";;
a ) CFG_APPLICATIONS="no";;
H ) CFG_HARDWARE="no";;
L ) CFG_STINLINE="no";;
p ) CFG_HPPROLIANTSERVER="yes";;
P ) CFG_PLUGINS="yes";;
A ) CFG_ALTIRISAGENTFILES="no";;
2 ) CFG_DATE="_"$(date +$OPTARG) ;;
1 ) CFG_DATE="_"$(date +%d-%b-%Y) ;;
0 ) CFG_DATE="_"$(date +%d-%b-%Y-%H%M) ;;
* ) echo "Unimplemented option chosen. Try -h for help!"; exit 1;; # DEFAULT
esac
done
shift $(($OPTIND - 1))
# Decrements the argument pointer so it points to next argument.
#
# linux port
MAILTO="jeroen.kleen@hp.com"
MAILTORALPH="cfg2html@hotmail.com"
# changed/added 08.07.2003 (13:04) by Ralph Roth
#####################################################################
# @(#)cfg2html (c) by ROSE SWE, Dipl.-Ing. Ralph Roth, [email protected]
# HP Proliant Server Module Integrated by [email protected]
#####################################################################
# cfg2html-linux ported (c) by Michael Meifert, SysAdm from HP-UX version
# using debian potato, woody
# This is the "swiss army knife" for the ASE, CE, sysadmin etc. I wrote it to
# get the needed information to plan an update, to perform basic trouble
# shooting or performance analysis. As a bonus cfg2html creates a nice HTML and
# plain ASCII documentation. If you are missing something, let me know it!
# History
#####################################################################
# 28-jan-1999 initial creation, based on get_config, check_config
# nickel, snapshoot, vim and a idea from a similar
# script i have seen on-site.
#####################################################################
# 11-Mar-2001 initial creation for debian GNU Linux i386
# based on Cfg2Html Version 1.15.06/HP-UX by
# by ROSE SWE, Dipl.-Ing. Ralph Roth
# ported to Linux by Michael Meifert
#####################################################################
# 15-May-2006 Common stream for cfg2html-linux and the Proliant version
line ( ) {
# http://www.cfg2html.com
echo ---=[ http://www.cfg2html.com ]=-----------------------------------------------
}
##echo -e "\n" # ???
echo "" # should be a newline, more portable? # rar, 20121230
## test if user = root
#
#if [ `id|cut -c5-11` != "0(root)" ] ; then
# Apparently they did away with the cut convention of interpreting -c0 the same as -c1. In fact c0 now produces an error.
# This can be found/tested on Fedora 9 and Ubuntu 8.04 if anyone cares.
if [ `id|cut -c1-6` != "uid=0(" ] ; then # 140906 rar, 160608 johnamurf
if [ -x /usr/bin/banner ] ; then
banner "Sorry!"
else
echo " ____ _"
echo "/ ___| ___ _ __ _ __ _ _| |"
echo "\___ \ / _ \| '__| '__| | | | |"
echo " ___) | (_) | | | | | |_| |_|"
echo "|____/ \___/|_| |_| \__, (_)"
echo " |___/"
fi
line
echo $0:$VERSION
echo -e "You must run this script as Root\n"
exit 1
fi
#
BASEFILE=`hostname||uname -n` # 26.01.2001 uname -n, fixed 0205-2006rr for OpenWRT
HTML_OUTFILE=$OUTDIR/$BASEFILE${CFG_DATE}.html
HTML_OUTFILE_TEMP=/tmp/$BASEFILE${CFG_DATE}.html.$$
TEXT_OUTFILE=$OUTDIR/$BASEFILE${CFG_DATE}.txt
TEXT_OUTFILE_TEMP=/tmp/$BASEFILE${CFG_DATE}.txt.$$
ERROR_LOG=$OUTDIR/$BASEFILE${CFG_DATE}.err
if [ ! -d $OUTDIR ] ; then
echo "can't create $HTML_OUTFILE, $OUTDIR does not exist - stop"
exit 1
fi
touch $HTML_OUTFILE
#echo "Starting up $VERSION\r"
[ -s "$ERROR_LOG" ] && rm -f $ERROR_LOG 2> /dev/null
DATE=`date "+%Y-%m-%d"` # ISO8601 compliant date string
DATEFULL=`date "+%Y-%m-%d %H:%M:%S"` # ISO8601 compliant date and time string
exec 2> $ERROR_LOG
if [ ! -f $HTML_OUTFILE ] ;
then
if [ -x /usr/bin/banner ] ; then
banner "Error"
else
echo "E R R O R"
fi
line
echo -e "You have not the rights to create the file $HTML_OUTFILE! (NFS?)\n"
exit 1
fi
logger "Start of $VERSION"
RECHNER=$(hostname) # `hostname -f`
VERSION_=`echo $VERSION/$RECHNER|tr " " "_"`
typeset -i HEADL=0 # Headinglevel
#
# check Linux distribution
#
distrib="unknown"
## rr, 15.12.2004 - "robertfantini"
if [ -f /etc/gentoo-release ] ; then
distrib="`head -1 /etc/gentoo-release`"
GENTOO="yes"
else
GENTOO="no"
fi
if [ -f /etc/slackware-version ] ; then
distrib="`cat /etc/slackware-version`"
SLACKWARE="yes"
else
SLACKWARE="no"
fi
## fix suggested by thomas bludau @ Dienstag, 19. Januar 2010
# fix suggested by MiMe/Donnerstag, 21. Januar 2010 - could you make it please easier:
# -UBUNTU_VERSION="`cat /etc/lsb-release | grep DISTRIB_DESCRIPTION | grep Ubuntu | sed \"s/DISTRIB_DESCRIPTION=//\" | sed \"s/\\\"//g\"`"
# +UBUNTU_VERSION=$(awk -F\" '/DISTRIB_DESCRIPTION/ {print $2}' /etc/lsb-release)
if [ -f /etc/debian_version ] ; then
if [ -f /etc/lsb-release ] ; then
# UBUNTU_VERSION="`cat /etc/lsb-release | grep DISTRIB_DESCRIPTION | grep Ubuntu | sed \"s/DISTRIB_DESCRIPTION=//\" | sed \"s/\\\"//g\"`"
UBUNTU_VERSION=$(awk -F\" '/DISTRIB_DESCRIPTION/ {print $2}' /etc/lsb-release)
fi
if [ "$UBUNTU_VERSION" ]; then
distrib=$UBUNTU_VERSION
UBUNTU="yes"
else
distrib="Debian GNU/Linux Version `cat /etc/debian_version`"
UBUNTU="no"
fi
DEBIAN="yes"
else
DEBIAN="no"
fi
if [ -f /etc/SuSE-release ] ; then
distrib="`head -1 /etc/SuSE-release`"
SUSE="yes"
else
SUSE="no"
fi
if [ -f /etc/mandrake-release ] ; then
distrib="`head -1 /etc/mandrake-release`"
MANDRAKE="yes"
else
MANDRAKE="no"
fi
if [ -f /etc/redhat-release ] ; then
distrib="`head -1 /etc/redhat-release`"
REDHAT="yes"
else
REDHAT="no"
fi
# MiMe: for UnitedLinux
if [ -f /etc/UnitedLinux-release ] ; then
distrib="`head -1 /etc/UnitedLinux-release`"
UNITEDLINUX="yes"
else
UNITEDLINUX="no"
fi
# M.Weiller, LUG-Ottobrunn.de, 2013-02-04
if [ -f /etc/arch-release ] ; then
distrib="`head -1 /etc/os-release | cut -f2 -d'"'`"
ARCH="yes"
else
ARCH="no"
fi
# B.Lake, Allegro Consultants, Inc., 2014-01-21, for AWS Linux
if [ -f /etc/system-release ] ; then
distrib="$(head -1 /etc/system-release)"
AWS="yes"
else
AWS="no"
fi
# i am looking for other distribution tests
####################################################################
# needs improvement!
# trap "echo Signal: Aborting!; rm $HTML_OUTFILE_TEMP" 2 13 15
####################################################################
####################################################################
# Header of HTML file
####################################################################
open_html() {
UNAMEA=$(uname -a)
echo -e " \
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML> <HEAD>
<META NAME="GENERATOR" CONTENT="Selfmade-$VERSION">
<META NAME="AUTHOR" CONTENT="Ralph Roth, Michael Meifert, Jeroen Kleen">
<META NAME="CREATED" CONTENT="Ralph Roth, Michael Meifert, Jeroen Kleen">
<META NAME="CHANGED" CONTENT="`id;date` ">
<META NAME="DESCRIPTION" CONTENT="$Header: /home/cvs/cfg2html/cfg2html_linux/cfg2html-linux,v 2.99 2015/04/06 08:45:15 ralph Exp $">
<META NAME="subject" CONTENT="$VERSION on $RECHNER by $MAILTO and $MAILTORALPH">
<style type="text/css">
/* (c) 2001-2015 by ROSE SWE, Ralph Roth - http://rose.rult.at
* CSS for cfg2html.sh, 12.04.2001, initial creation
*/
Pre {Font-Family: Courier-New, Courier;Font-Size: 10pt}
BODY {FONT-FAMILY: Arial, Verdana, Helvetica, Sans-serif; FONT-SIZE: 12pt;}
A {FONT-FAMILY: Arial, Verdana, Helvetica, Sans-serif}
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:hover {text-decoration: underline}
A:active {color: red; text-decoration: none}
H1 {FONT-FAMILY: Arial, Verdana, Helvetica, Sans-serif;FONT-SIZE: 20pt}
H2 {FONT-FAMILY: Arial, Verdana, Helvetica, Sans-serif;FONT-SIZE: 14pt}
H3 {FONT-FAMILY: Arial, Verdana, Helvetica, Sans-serif;FONT-SIZE: 12pt}
DIV, P, OL, UL, SPAN, TD
{FONT-FAMILY: Arial, Verdana, Helvetica, Sans-serif;FONT-SIZE: 11pt}
</style>
<TITLE>${RECHNER} - System Documentation - $VERSION</TITLE>
</HEAD><BODY>
<BODY LINK="#0000ff" VLINK="#800080" BACKGROUND="cfg2html_back.jpg">
<H1><CENTER><FONT COLOR=blue>
<P><hr><B>$RECHNER - System Documentation</P></H1>
<hr><FONT COLOR=blue><small>Created "$DATEFULL" with " $VERSION "</font></center></B><P>
$UNAMEA
</small>
<HR><H1>Contents\n</font></H1>\n\
" >$HTML_OUTFILE
(line
if [ -x /usr/bin/banner ] ; then
banner $RECHNER
else
echo
echo " "$RECHNER
echo
fi;line) > $TEXT_OUTFILE
echo -e "\n" >> $TEXT_OUTFILE
echo -e "\n" > $TEXT_OUTFILE_TEMP
}
######################################################################
# Increases the headling level
######################################################################
inc_heading_level() {
HEADL=HEADL+1
# echo -e "<UL>\n" >> $HTML_OUTFILE
echo -e "<UL type='square'>\n" >> $HTML_OUTFILE
}
######################################################################
# Decreases the heading level
######################################################################
dec_heading_level() {
HEADL=HEADL-1
echo -e "</UL>" >> $HTML_OUTFILE
}
######################################################################
# Creates an own paragraph, $1 = heading
######################################################################
paragraph() {
if [ "$HEADL" -eq 1 ] ; then
echo -e "<HR>" >> $HTML_OUTFILE_TEMP
fi
echo "<A NAME=\"$1\">" >> $HTML_OUTFILE_TEMP
echo "<A HREF=\"#Inhalt-$1\"><H${HEADL}> $1 </H${HEADL}></A><P>" >> $HTML_OUTFILE_TEMP
# commented to eliminate the need of the gif
#echo "<IMG SRC="profbull.gif" WIDTH=14 HEIGHT=14>" >> $HTML_OUTFILE
echo "<A NAME=\"Inhalt-$1\"></A><A HREF=\"#$1\">$1</A>" >> $HTML_OUTFILE
echo -e "\nCollecting: " $1 " .\c"
echo " $1 ---- " >> $TEXT_OUTFILE
}
######################################################################
# Documents the single commands and their output
# $1 = unix command, $2 = text for the heading
######################################################################
exec_command() {
echo -e ".\c" # fails under Ubuntu/Linit Mint based systems!?
echo -e "\n---=[ $2 ]=----------------------------------------------------------------" | cut -c1-74 >> $TEXT_OUTFILE_TEMP
echo " - $2" >> $TEXT_OUTFILE
######the working horse##########
TMP_EXEC_COMMAND_ERR=/tmp/exec_cmd.tmp.$$
## Modified 1/13/05 by [email protected], Marc Korte, TEKsystems (150 -> 250)
EXECRES=`eval $1 2> $TMP_EXEC_COMMAND_ERR | expand | cut -c 1-250`
########### test it ############
# Convert illegal characters for HTML into escaped ones.
#CONVSTR='
#s/</\</g
#s/>/\>/g
#s/\\/\\/g
#'
#EXECRES=$(eval $1 2> $TMP_EXEC_COMMAND_ERR | expand | cut -c 1-150 | sed +"$CONVSTR")
if [ -z "$EXECRES" ]
then
EXECRES="n/a or not configured"
fi
if [ -s $TMP_EXEC_COMMAND_ERR ]
then
echo "stderr output from \"$1\":" >> $ERROR_LOG
cat $TMP_EXEC_COMMAND_ERR | sed 's/^/ /' >> $ERROR_LOG
fi
rm -f $TMP_EXEC_COMMAND_ERR
## echo -e "\n" >> $HTML_OUTFILE_TEMP
## echo -e "<A NAME=\"$2\"></A> <A HREF=\"#Inhalt-$2\"><H${HEADL}> $2 </H${HEADL}></A>\n" >>$HTML_OUTFILE_TEMP
## echo -e "<PRE><B>$EXECRES</B></PRE>\n" >>$HTML_OUTFILE_TEMP
## #echo "<PRE><SMALL><B>$EXECRES</B></SMALL></PRE>\n" >>$HTML_OUTFILE_TEMP
## echo -e "<LI><A NAME=\"Inhalt-$2\"></A><A HREF=\"#$2\">$2</A>\n" >> $HTML_OUTFILE
## echo -e "\n$EXECRES\n" >> $TEXT_OUTFILE_TEMP
#### new ### # 13.08.2007, 13:28 modified by Ralph Roth
if [ "$CFG_STINLINE" = "no" ]
then
## screen tips like cfg2html 1.20 when dragging mouse over link?
echo -e "<A NAME=\"$2\"></A> <H${HEADL}><A HREF=\"#Inhalt-$2\" title=\"$1\"> $2 </A></H${HEADL}>" >>$HTML_OUTFILE_TEMP #orig screen tips by Ralph
else
## or more netscape friendly inline?
echo -e "<A NAME=\"$2\"></A> <A HREF=\"#Inhalt-$2\"><H${HEADL}> $2 </H${HEADL}></A>" >>$HTML_OUTFILE_TEMP
if [ "X$1" = "X$2" ]
then : #no need to duplicate, do nothing
else
echo "<h6>$1</h6>">>$HTML_OUTFILE_TEMP
fi
fi # screen tips inline???
### Put the result out in proportional font
echo -e "<PRE>$EXECRES</PRE>" >>$HTML_OUTFILE_TEMP
echo -e "<LI><A NAME=\"Inhalt-$2\"></A><A HREF=\"#$2\" title=\"$1\">$2</A>" >> $HTML_OUTFILE
echo "$EXECRES" >> $TEXT_OUTFILE_TEMP
}
################# Schedule a job for killing commands which ###############
################# may hang under special conditions. <[email protected]> #####
# Argument 1: regular expression to search process list for. Be careful
# when specifying this so you don't kill any more processes than
# those you are looking for!
# Argument 2: number of minutes to wait for process to complete.
KillOnHang() {
TMP_KILL_OUTPUT=/tmp/kill_hang.tmp.$$
at now + $2 minutes 1>$TMP_KILL_OUTPUT 2>&1 <<EOF
# ps -ef | grep root | grep -v grep | grep $1 | awk '{print \$2}' | sort -n -r | xargs kill
# ps -ef | grep $1 | awk '/root/ && !/grep/ {print $2}' | sort -n -r | xargs kill
ps -ef | grep $1 | awk '/root/ && !/grep/ {print $2}' | sort -n -r | xargs kill
EOF
AT_JOB_NR=`awk ' /^job/ {print $2}' $TMP_KILL_OUTPUT`
rm -f $TMP_KILL_OUTPUT
}
# You should always match a KillOnHang() call with a matching call
# to this function immediately after the command which could hang
# has properly finished.
CancelKillOnHang() {
at -r $AT_JOB_NR
}
################# adds a text to the output files, rar, 25.04.99 ##########
AddText() {
echo "<p>$*</p>" >> $HTML_OUTFILE_TEMP
echo -e "$*\n" >> $TEXT_OUTFILE_TEMP
}
# B.Lake, Allegro Consultants, Inc., 2014-01-21, attempt to clean up the code a bit
BoldText()
{
echo -e "\n<br><B>$*</B>" >> $HTML_OUTFILE_TEMP
echo -e "\n===== $* =====" >> $TEXT_OUTFILE_TEMP
}
######################################################################
# Ende des Dokumentes
######################################################################
# end of the html document
######################################################################
close_html() {
echo "<hr>" >> $HTML_OUTFILE
echo -e "</P><P>\n<hr><FONT COLOR=blue>Created "$DATEFULL" with " $VERSION "</font>" >> $HTML_OUTFILE_TEMP
echo -e "</P><P>\n<FONT COLOR=blue>Copyright and maintained by <A HREF="mailto:$MAILTORALPH?subject=$VERSION_">Ralph Roth, ROSE SWE, </A></P></font>" >> $HTML_OUTFILE_TEMP
echo -e "<hr><center> <A HREF="http://www.cfg2html.com">[ Download cfg2html from external home page ]</b></A></center></P><hr></BODY></HTML>\n" >> $HTML_OUTFILE_TEMP
cat $HTML_OUTFILE_TEMP >>$HTML_OUTFILE
cat $TEXT_OUTFILE_TEMP >> $TEXT_OUTFILE
rm $HTML_OUTFILE_TEMP $TEXT_OUTFILE_TEMP
echo -e "\n\nCreated "$DATEFULL" with " $VERSION " \n" >> $TEXT_OUTFILE
echo -e "(c) 1998-2015 by ROSE SWE, Ralph Roth" >> $TEXT_OUTFILE
}
my_df() {
# df summary for Linux, Chris Gardner, 26-Jan-2012
df -kl -x rootfs -x devtmpfs -x tmpfs -x iso9660 --total |tail -n1 |awk '{
print "Allocated\tUsed \t \tAvailable\tUsed (%)";
printf "%ld \t%ld \t%ld\t \t%3.1f\n", $2, $3, $4, $5;
}'
}
PVDisplay ( ) {
#function used in LVM-section
# for disk in $(strings /etc/lvmtab.d/* |grep -e hd -e sc) ;
for disk in $(vgdisplay -v 2> /dev/null | awk -F\ + '/PV Name/ {print $4}'); # fix by Alvaro Jimenez Cabrera, Mittwoch, 5. November 2008
do
pvdisplay -v $disk; # due to PATH problems; A. Kumpf, 21.07.06???
done
}
#
######################################################################
# Hauptprogramm mit Aufruf der obigen Funktionen und deren Parametern
############################# M A I N ##############################
#
line
echo "Starting "$VERSION ## "/"$(arch) - won't work under Debian 5.0.8 ## /usr/bin/cfg2html-linux: line 597: arch: command not found
echo "Path to cfg2html "$0
echo "HTML Output File "$HTML_OUTFILE
echo "Text Output File "$TEXT_OUTFILE
echo "Partitions "$OUTDIR/$BASEFILE.partitions.save
echo "Errors logged to "$ERROR_LOG
echo "Started at "$DATEFULL
[[ -f $CONFIG_DIR/local.conf ]] && {
echo "Local config "$CONFIG_DIR/local.conf
}
echo "This version of cfg2html is in maintenance mode and only receives bug fixes!"
echo "For new features please use cfg2html 6.xx instead!"
echo ""
echo "WARNING USE AT YOUR OWN RISK!!! :-)) <<<<<"
line
logger "Start of $VERSION"
open_html
inc_heading_level
#
# CFG_SYSTEM
#
if [ "$CFG_SYSTEM" != "no" ]
then # else skip to next paragraph
paragraph "Linux System ($distrib)"
inc_heading_level
if [ -f /etc/cfg2html/systeminfo ] ; then
exec_command "cat /etc/cfg2html/systeminfo" "System description"
fi
exec_command "cat /proc/cpuinfo; echo; /usr/bin/lscpu;" "CPU and Model info" # 20.08.2012, 15:59 modified by Ralph Roth #* rar *#
[ -x /usr/bin/cpufreq-info ] && exec_command cpufreq-info "CPU Freq Kernel Information"
HostNames() {
uname -a
echo "DNS Domainname = "`dnsdomainname `
echo "NIS Domainname = "`domainname 2>/dev/null `
echo "Hostname (short)= "`hostname`
echo "Hostname (FQDN) = "`hostname -f`
}
exec_command HostNames "uname & hostname"
exec_command "uname -n" "Host alias"
exec_command "uname -sr" "OS, Kernel version"
[ -x /usr/bin/lsb_release ] && exec_command "/usr/bin/lsb_release -a" "Linux Standard Base Version"
## Dusan Baljevic: simplified LAN status
[ -x /usr/bin/facter ] && exec_command "facter" "Facter for local local system"
for i in /etc/*-release
do
[ -r $i ] && exec_command "cat $i" "OS Specific Release Information ($i)"
done
posixversion() {
# wie findet man das bei Linux raus?
#echo "POSIX Version: \c"; getconf POSIX_VERSION
#echo "POSIX Version: \c"; getconf POSIX2_VERSION
#echo "X/OPEN Version: \c"; getconf XOPEN_VERSION
echo "LANG setting: "$LANG
[ -r /etc/sysconfig/i18n ] && cat /etc/sysconfig/i18n
}
if [ -x /usr/bin/locale ] ; then
exec_command posixversion "POSIX Standards/Settings"
exec_command "locale" "locale specific information"
export LANG="C"
export LANG_ALL="C"
fi
exec_command "ulimit -a" "System ulimit" # 13.08.2007, 14:24 modified by Ralph Roth
exec_command "getconf -a" "System Configuration Variables" ## at least SLES11, # 14.06.2011, 18:53 modified by Ralph Roth #* rar *#
##### 19-Sept-2006, Ralph #####
if [ -x /usr/bin/mpstat ] ; then
exec_command "mpstat 1 5" "MP-Statistics"
fi
if [ -x /usr/bin/iostat ] ; then
exec_command "iostat" "IO-Statistics"
fi
# In "used memory.swap" section I would add :
# free -tl (instead of free, because it gives some more useful infos, about HighMem and LowMem memory regions (zones))
# cat /proc/meminfo (in order to get some details of memory usage)
exec_command "free -toml;echo;free -tm;echo; swapon -s" "Used Memory and Swap" # 04.07.2011, 16:13 modified by Ralph Roth #* rar *#
exec_command "cat /proc/meminfo; echo THP:; cat /sys/kernel/mm/transparent_hugepage/enabled" "Detailed Memory Usage (meminfo)" # changed 20131218 by Ralph Roth
exec_command "cat /proc/buddyinfo" "Zoned Buddy Allocator/Memory Fragmentation and Zones" # 09.01.2012 Ralph Roth
AddText "The number on the left is bigger than right (by factor 2)."
AddText "DMA zone is the first 16 MB of memory. DMA64 zone is the first 4 GB of memory on 64-bit Linux. Normal zone is between DMA and HighMem. HighMem zone is above 4 GB of memory." # ripped from Dusan Baljevic ## changed 20131211 by Ralph Roth
# TODO
# foreach my $bi ( @BUDDYINFO ) {
# my @biarr = split(/\s+/, $bi);
# $biarr[1] =~ s/,$//g;
# print "$INFOSTR $biarr[0]$biarr[1]: Zone $biarr[3] has\n";
# my $cntb = 1;
# my @who = splice @biarr, 4;
# for my $p (0 .. $#who) {
# print $who[$p], " free ", 2*(2**$cntb), "KB pages\n";
# $cntb++;
# }
exec_command "cat /proc/slabinfo" "Kernel slabinfo Statistics" # changed 20131211 by Ralph Roth
AddText "Frequently used objects in the Linux kernel (buffer heads, inodes, dentries, etc.) have their own cache. The file /proc/slabinfo gives statistics."
exec_command "cat /proc/pagetypeinfo" "Additional page allocator information" # changed 20131211 by Ralph Roth
exec_command "cat /proc/zoneinfo" "Per-zone page allocator" # changed 20131211 by Ralph Roth
if [ -x /usr/bin/vmstat ] ; then ## <c/m/a> 14.04.2009 - Ralph Roth
exec_command "vmstat 1 10" "VM-Statistics 1 10"
exec_command "vmstat -dn;vmstat -f" "VM-Statistics (Summary)"
fi
# sysutils
exec_command "uptime" "Uptime"
# exec_command "sar 1 9" "System Activity Report"
# exec_command "sar -b 1 9" "Buffer Activity"
[ -x /usr/bin/procinfo ] && exec_command "procinfo -a" "System status from /proc" # 15.11.2004, 14:09 modified by Ralph Roth
# usage: pstree [ -a ] [ -c ] [ -h | -H pid ] [ -l ] [ -n ] [ -p ] [ -u ]
# [ -G | -U ] [ pid | user]
#### 20070228 Oliver Schwabedissen, RH4/SLES9 don't support -A, RHEL 5.6 supports -A (# 08.04.2011, 11:31 modified by Ralph Roth #* rar *#)
# if [ "$REDHAT" = "yes" ] ; then ## 20100914 Alfred Menken SLES10/SLESS11 support -A
# exec_command "pstree -p -a -l -G" "Active Process Overview" # 090102006
topFDhandles () ## new 20130124 by Ralph Roth
{
echo "Nr.OpenFileHandles PID Command+Commandline"
(ls /proc/ | awk '{if($1+0==0) print " "; else system("echo `ls /proc/"$1+0"/fd |wc -l` \t PID="$1" \t CMD=`cat /proc/"$1+0"/cmdline` ")}' | sort -nr | head -25) 2> /dev/null
}
exec_command "pstree -p -a -l -G -A" "Active Process - Tree Overview" # 15.11.2004/2011, 14:09 modified by Ralph.Roth
exec_command "ps -e -o ruser,pid,args | awk '{ if (($1+1) > 1) {print $0;} }'" "Processes without an named owner" # changed 20131211 by Ralph Roth, # changed 20140129 by Ralph Roth # cmd. line:1: ^ unexpected newline or end of string
AddText "The output should be empty!"
exec_command "ps -ef | cut -c39- | sort -nr | head -25 | awk '{ printf(\"%10s %s\\n\", \$1, \$2); }'" "Top load processes"
## ps -eo pid,pri,psr,pcpu,stat,wchan=WIDE-WCHAN-COLUMN,command
## ps aux --sort=-%cpu,-%mem|head -25 ## 06.03.2015
exec_command "ps -e -o 'vsz pid ruser cpu time args' |sort -nr|head -25" "Top memory consuming processes"
exec_command topFDhandles "Top file handles consuming processes" # 24.01.2013
AddText "Hint: Number of open file handles should be less than ulimit -n ("$(ulimit -n)")"
[ -x /usr/bin/pidstat ] && exec_command "pidstat -lrud 2>/dev/null||pidstat -rud" "pidstat - Statistics for Linux Tasks" # 10.11.2012, 07:35 modified by Ralph Roth #* rar *# fixed for SLES11 SP2//29.01.2014//rr
exec_command "last| grep boot" "reboots" ### better? last -n 5 reboot #### RR, 2014-12-19
exec_command "alias" "Alias"
[ -r /etc/inittab ] && exec_command "grep -vE '^#|^ *$' /etc/inittab" "inittab"
## This may report NOTHING on RHEL 3+4 ##
[ -x /sbin/chkconfig ] && exec_command "/sbin/chkconfig" "Services Startup" ## chkconfig -A // SLES // xinetd missing
[ -x /sbin/chkconfig ] && exec_command "/sbin/chkconfig --list" "Services Runlevel" # rar, fixed 2805-2005 for FC4
[ -x /sbin/chkconfig ] && exec_command "/sbin/chkconfig -l --deps" "Services Runlevel and dependencies" #*# Alexander De Bernardi 25.02.2011
[ -x /usr/sbin/service ] && exec_command "/usr/sbin/service --status-all 2> /dev/null" "Services - Status" # 09.11.2011/12022013 by Ralph Roth #* rar *#
[ -x /usr/sbin/sysv-rc-conf ] && exec_command " /usr/sbin/sysv-rc-conf --list" "Services Runlevel" # rr, 1002-2008
if [ "$GENTOO" = "yes" ] ; then ## 2007-02-27 Oliver Schwabedissen
[ -x /bin/rc-status ] && exec_command "/bin/rc-status --list" "Defined runlevels"
[ -x /sbin/rc-update ] && exec_command "/sbin/rc-update show --verbose" "Init scripts and their runlevels"
fi
## OpenSUSE 12.x # changed 20140213 by Ralph Roth ##BACKPORT##
[ -x /usr/bin/systemctl ] && exec_command "/usr/bin/systemctl" "Systemd: System and Service Manager"
[ -x /usr/bin/systemctl ] && exec_command "/usr/bin/systemctl list-units --type service" "Systemd: All Services"
[ -x /usr/bin/systemctl ] && exec_command "systemctl list-unit-files" " Systemd: All Unit Files"
if [ "$ARCH" = "yes" ] ; then ## M.Weiller, LUG-Ottobrunn.de, 2013-02-04 ## OpenSUSE also and SLES12?
[ -x /usr/bin/systemctl ] && exec_command "/usr/bin/systemctl --failed" "Systemd: Failed Units"
fi
if [ -d /etc/rc.config.d ] ; then
exec_command " grep -v ^# /etc/rc.config.d/* | grep '=[0-9]'" "Runlevel Settings"
fi
[ -r /etc/inittab ] && exec_command "awk '!/#|^ *$/ && /initdefault/' /etc/inittab" "default runlevel"
exec_command "/sbin/runlevel" "current runlevel"
##
## we want to display the Boot Messages too
## 30Jan2003 it233 FRU
if [ -e /var/log/boot.msg ] ; then
exec_command "grep 'Boot logging' /var/log/boot.msg" "Last Boot Date"
exec_command "grep -v '|====' /var/log/boot.msg " "Boot Messages, last Boot"
fi
# MiMe: SUSE && UNITEDLINUX
# MiMe: until SuSE 7.3: params in /etc/rc.config and below /etc/rc.config.d/
# MiMe; since SuSE 8.0 including UL: params below /etc/sysconfig
if [ "$SUSE" = "yes" ] || [ "$UNITEDLINUX" = "yes" ] ; then
if [ -d /etc/sysconfig ] ; then
# MiMe:
exec_command "find /etc/sysconfig -type f -not -path '*/scripts/*' -exec grep -vE '^#|^ *$' {} /dev/null \; | sort" "Parameter /etc/sysconfig"
fi
if [ -e /etc/rc.config ] ; then
# PJC: added filters for SuSE rc_ variables
# PJC: which were in rc.config in SuSE 6
# PJC: and moved to /etc/rc.status in 7+
exec_command "grep -vE -e '(^#|^ *$)' -e '^ *rc_' -e 'rc.status' /etc/rc.config | sort" "Parameter /etc/rc.config"
fi
if [ -d /etc/rc.config.d ] ; then
# PJC: added filters for SuSEFirewall and indented comments
exec_command "find /etc/rc.config.d -name '*.config' -exec grep -vE -e '(^#|^ *$)' -e '^ *true$' -e '^[[:space:] ]*#' -e '[{]|[}]' {} \; | sort" "Parameter /etc/rc.config.d"
fi
fi
if [ "$GENTOO" = "yes" ] ; then ## 2007-02-28 Oliver Schwabedissen
exec_command "grep -vE '^#|^ *$' /etc/rc.conf | sort" "Parameter /etc/rc.conf"
exec_command "find /etc/conf.d -type f -exec grep -vE '^#|^ *$' {} /dev/null \;" "Parameter /etc/conf.d"
fi
if [ -e /proc/sysvipc ] ; then
exec_command "ipcs" "IPC Status"
exec_command "ipcs -u" "IPC Summary"
exec_command "ipcs -l" "IPC Limits"
## ipcs -ma ???
fi
### Made by [email protected] ### 16.03.2014
if [ -x /usr/sbin/authconfig ] ; then
exec_command "/usr/sbin/authconfig --test" "System authentication resources"
fi
if [ -x /usr/sbin/pwck ] ; then
exec_command "/usr/sbin/pwck -r && echo Okay" "integrity of password files"
fi
if [ -x /usr/sbin/grpck ] ; then
exec_command "/usr/sbin/grpck -r && echo Okay" "integrity of group files"
fi
dec_heading_level
fi # terminates CFG_SYSTEM wrapper
#
# Begin: "Arch Linux spezial section"
## M.Weiller, LUG-Ottobrunn.de, 2013-02-04
if [ "$ARCH" == "yes" ] ; then
paragraph "Arch Linux spezial"
inc_heading_level
exec_command "grep -vE '^#|^ *$' /etc/pacman.conf" "Pacman config"
exec_command "grep -vE '^#|^ *$' /etc/pacman.d/mirrorlist" "Aktiv mirrors for pacman"
exec_command "grep -vE '^#|^ *$' /etc/mkinitcpio.conf" "Build Options"
dec_heading_level
fi
# End: "Arch Linux spezial section"
#
#
# CFG_CRON
#
if [ "$CFG_CRON" != "no" ]
then # else skip to next paragraph
paragraph "Cron and At"
inc_heading_level
for FILE in cron.allow cron.deny
do
if [ -r /etc/$FILE ]
then
exec_command "cat /etc/$FILE" "$FILE"
else
exec_command "echo /etc/$FILE" "$FILE not found!"
fi
done
## Linux SuSE user /var/spool/cron/tabs and NOT crontabs
## 30jan2003 it233 FRU
## SuSE has the user crontabs under /var/spool/cron/tabs
## RedHat has the user crontabs under /var/spool/cron
## UnitedLinux uses /var/spool/cron/tabs (MiMe)
## Arch Linux has the user crontabs under /var/spool/cron ## M.Weiller, LUG-Ottobrunn.de, 2013-02-04
## AWS Linux has the user crontabs under /var/spool/cron ## B.Lake, 2014-01-21
if [ "$SUSE" == "yes" ] ; then
usercron="/var/spool/cron/tabs"
fi
if [ "$REDHAT" == "yes" ] ; then
usercron="/var/spool/cron"
fi
if [ "$SLACKWARE" == "yes" ] ; then
usercron="/var/spool/cron/crontabs"
fi
if [ "$DEBIAN" == "yes" ] ; then
usercron="/var/spool/cron/crontabs"
fi
if [ "$GENTOO" == "yes" ] ; then ## 2007-02-27 Oliver Schwabedissen
usercron="/var/spool/cron/crontabs"
fi
if [ "$UNITEDLINUX" == "yes" ] ; then
usercron="/var/spool/cron/tabs"
fi
if [ "$ARCH" == "yes" ] ; then ## M.Weiller, LUG-Ottobrunn.de, 2013-02-04
usercron="/var/spool/cron"
fi
# ##
# alph@osuse122rr:/etc/cron.d> ll
# -rw-r--r-- 1 root root 1754 29. Nov 16:21 -? ## !
# -rw-r--r-- 1 root root 319 1. Nov 2011 ClusterTools2
# -rw-r--r-- 1 root root 1754 29. Nov 16:21 --help ## !
ls $usercron/* > /dev/null 2>&1
if [ $? -eq 0 ]
then
# echo -e "\n\n<B>Crontab files:</B>" >> $HTML_OUTFILE_TEMP
BoldText "Crontab files:"
for FILE in $usercron/*
do
exec_command "cat $FILE | grep -v ^#" "For user `basename $FILE`"
done
else
echo "No crontab files for user.<br>" >> $HTML_OUTFILE_TEMP
fi
##
## we do also a listing of utility cron files
## under /etc/cron.d 30Jan2003 it233 FRU
ls /etc/cron.d/* > /dev/null 2>&1
if [ $? -eq 0 ]
then
# echo -e "\n\n<br><B>/etc/cron.d files:</B>" >> $HTML_OUTFILE_TEMP
BoldText "/etc/cron.d files:"
for FILE in /etc/cron.d/*
do
exec_command "cat $FILE | grep -v ^#" "For utility `basename $FILE`"
done
else
echo "No /etc/cron.d files for utlities." >> $HTML_OUTFILE_TEMP
fi
if [ -f /etc/crontab ] ; then
exec_command "echo -e 'Crontab:\n';cat /etc/crontab | grep -vE '^#|^ *$'" "/etc/crontab"
fi
# B.Lake, Allegro Consultants, Inc., 2014-01-21, add displays for anacron tables:
# /etc/anacrontab, /etc/cron.hourly/, /etc/cron.daily/, /etc/cron.weekly/, /etc/cron.monthly
if [ "$AWS" == "yes" ] || [ "$REDHAT" == "yes" ] ; then
if [ -s /etc/anacrontab ] ; then
BoldText "Anacron Schedules:"
exec_command "grep -vE '^$|^#' /etc/anacrontab" "Master Anacron"
for DIR in hourly daily weekly monthly ; do
if [ -d /etc/cron.$DIR ] ; then
FILES=$(ls /etc/cron.$DIR/* 2>/dev/null)
if [ -n "$FILES" ] ; then
for FILE in $FILES ; do
exec_command "grep -vE '^$|^#' $FILE" "$FILE"
done
fi
fi
done
fi
fi
atconfigpath="/etc"
if [ "$GENTOO" == "yes" ] ; then ## 2007-02-27 Oliver Schwabedissen
atconfigpath="/etc/at"
fi
for FILE in at.allow at.deny
do
if [ -r $atconfigpath/$FILE ]
then
exec_command "cat $atconfigpath/$FILE " "$atconfigpath/$FILE"
else
exec_command "echo $atconfigpath/$FILE" "No $atconfigpath/$FILE"
fi
done
## work around by Ralph for missing at
#(whereis at > /dev/null) || exec_command "at -l" "AT Scheduler"
# sorry - don't work here (Michael)
# now we try this
if [ -x /usr/bin/at ] ; then