概要 †
cron用スクリプトを順番に1つずつ消化するためのスクリプトです。
コード †
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
| -
!
-
|
|
!
-
!
-
!
-
!
-
!
-
!
-
!
-
!
-
!
-
!
-
!
-
-
|
|
!
|
|
-
!
|
-
!
|
|
MAIL_ADDRESS="[email protected]"
MAIL_TITLE="[$(hostname)] chain(daily)"
CURRENT="/root/cron_scripts"
SCRIPT_LIST=(
exec-checker.sh
gomi-checker.sh
chkrootkit_d.sh
rkhunter_d.sh
avira_d.sh
tripwire_d.sh
logrotate_d.sh
)
MAIL=/usr/bin/mail
LINE="--------------------"
DATE_FORMAT="%m/%d-%H:%M:%S"
OUTFILE=`/bin/mktemp` || exit 1
for i in ${SCRIPT_LIST[*]}
do
/bin/echo -e "\n$LINE" `date +$DATE_FORMAT` " Start $i $LINE" &>> $OUTFILE
$CURRENT/$i 2>> $OUTFILE
done
/bin/echo -e "\n$LINE" `date +$DATE_FORMAT` " End Chain $LINE" &>> $OUTFILE
/bin/cat $OUTFILE | tr -d '\r' | $MAIL -s "$MAIL_TITLE" "$MAIL_ADDRESS"
/bin/rm -f $OUTFILE
|
検証時の環境 †