This file is indexed.

/usr/share/yasat/plugins/ntp.test is in yasat 526-1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 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
#!/bin/sh
################################################################################
#                                                                              #
#   Copyright (C) 2008-2012 LABBE Corentin <corentin.labbe@geomatys.fr>
#
#    YASAT is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    YASAT is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with YASAT.  If not, see <http://www.gnu.org/licenses/>.
#                                                                              #
################################################################################


Title "Check ntp and ntpd"

#i known only ntpd and openntpd
FOUND_NTPD=0
ACTUAL_NTPD=''
#/usr/sbin/ntpd can be ntpd or openntpd
#On openBSD openntpd is ntpd:
POSSIBLE_NTPD_BINARIES="/usr/sbin/ntpd openntpd ntpd: ntpd chronyd /usr/sbin/chronyd"

for NTPD_TO_TEST in $POSSIBLE_NTPD_BINARIES
do
	RESULTAT="`ps aux |grep -i $NTPD_TO_TEST |grep -v grep`"
	if [ ! -z "$RESULTAT" ]
	then
		Display --indent 2 --text "$NTPD_TO_TEST" --result FOUND --color GREEN
		FOUND_NTPD=1
		ACTUAL_NTPD="$NTPD_TO_TEST"
	fi
done

if [ $FOUND_NTPD -eq 0 ]
then
		Display --indent 2 --text "NTP daemon" --result NOTFOUND --color RED --advice NTPD_NO_NTPD
else
		Display --indent 2 --text "NTP daemon $ACTUAL_NTPD" --result FOUND --color GREEN
fi

POSSIBLE_NTPD_CONF="/etc/openntpd/ntpd.conf /etc/ntpd.conf /etc/ntp.conf"
NTPD_CONF='/etc/ntpd.conf'
for LOCATION in ${POSSIBLE_NTPD_CONF}
do
	if [ -e "${LOCATION}" ]
	then
		NTPD_CONF="${LOCATION}"
	fi
done

if [ -e "$NTPD_CONF" ]
then
	Display --indent 2 --text "$NTPD_CONF" --result FOUND --color BLUE
else
	Display --indent 2 --text "NTPD configuraton file" --result NOTFOUND --color BLUE
fi

#if [ "$OS_TYPE" = 'BSD' ]
#then
#TODO ntpdate_enable="YES"
#TODO ntpd_enable="YES"
#fi

#TODO restrict default ignore

return 0;