Sat, 18 Jul 2020 15:55:11 +0200
Version 0.23 some fixes for newer awk versions.
5 | 1 | #!/bin/bash |
2 | # | |
3 | ############################################################################# | |
16
37f217a8bcce
Fixed check mailq on ssmtp systems
Michiel Broek <mbroek@mbse.eu>
parents:
14
diff
changeset
|
4 | # Copyright (C) 2005-2013 |
5 | 5 | # |
16
37f217a8bcce
Fixed check mailq on ssmtp systems
Michiel Broek <mbroek@mbse.eu>
parents:
14
diff
changeset
|
6 | # Michiel Broek <mbse at mbse.eu> |
5 | 7 | # |
14
59e07bba67cc
Fixed spelling error, updated address
Michiel Broek <mbse@mbse.eu>
parents:
5
diff
changeset
|
8 | # This file is part of SlackSecCheckScripts. |
5 | 9 | # |
10 | # This package is free software; you can redistribute it and/or modify it | |
11 | # under the terms of the GNU General Public License as published by the | |
12 | # Free Software Foundation; either version 2, or (at your option) any | |
13 | # later version. | |
14 | # | |
14
59e07bba67cc
Fixed spelling error, updated address
Michiel Broek <mbse@mbse.eu>
parents:
5
diff
changeset
|
15 | # SlackSecCheckScripts is distributed in the hope that it will be useful, but |
5 | 16 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 | # General Public License for more details. | |
19 | # | |
20 | # You should have received a copy of the GNU General Public License | |
21 | # along with MBSE BBS; see the file COPYING. If not, write to the Free | |
22 | # Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
23 | ############################################################################# | |
24 | ||
16
37f217a8bcce
Fixed check mailq on ssmtp systems
Michiel Broek <mbroek@mbse.eu>
parents:
14
diff
changeset
|
25 | # If the system is using ssmtp then there is no queue to check |
37f217a8bcce
Fixed check mailq on ssmtp systems
Michiel Broek <mbroek@mbse.eu>
parents:
14
diff
changeset
|
26 | [ -x /usr/sbin/ssmtp ] && exit |
37f217a8bcce
Fixed check mailq on ssmtp systems
Michiel Broek <mbroek@mbse.eu>
parents:
14
diff
changeset
|
27 | |
5 | 28 | PATH=/sbin:/usr/sbin:/bin:/usr/bin |
29 | ||
30 | umask 077 | |
31 | TZ=UTC; export TZ | |
32 | LANG=C; export LANG | |
33 | ||
34 | SECUREDIR=`mktemp -d /tmp/_securedir.XXXXXX` || exit 1 | |
35 | ||
36 | trap "/bin/rm -rf $SECUREDIR ; exit 0" EXIT INT QUIT PIPE | |
37 | ||
38 | if ! cd "$SECUREDIR"; then | |
39 | echo "Can not cd to $SECUREDIR". | |
40 | exit 1 | |
41 | fi | |
42 | ||
43 | TMP=$SECUREDIR/tmp | |
44 | ||
45 | # Check mailqueue | |
46 | # | |
47 | mailq > $TMP | |
48 | if ! grep -q "queue is empty$" $TMP; then | |
49 | echo "" | |
50 | echo "mail:" | |
51 | cat $TMP | |
52 | fi | |
53 |