File: puppet.test

package info (click to toggle)
yasat 526-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 920 kB
  • sloc: sh: 4,723; makefile: 47
file content (63 lines) | stat: -rw-r--r-- 2,086 bytes parent folder | download
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
#!/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/>.
#                                                                              #
################################################################################


POSSIBLE_PUPPET_CONF="/etc/puppet/puppet.conf /usr/local/etc/puppet/puppet.conf"
PUPPET_CONF="/etc/puppet/puppet.conf"

for LOCATION in ${POSSIBLE_PUPPET_CONF}
do
	if [ -e "${LOCATION}" ] ;then
		PUPPET_CONF="${LOCATION}"
	fi
done

PUPPET_CONF="`dirname $PUPPET_CONF`/puppet.conf"

Title "Check Puppet"

if [ ! -e "$PUPPET_CONF" ]
then
	return 1;
fi

#TODO puppet user

Display --indent 2 --text "$PUPPET_CONF" --result FOUND --color GREEN
get_simple_right "$PUPPET_CONF"
if [ "$RESULTAT" = '640' ]
then
	Display --indent 4 --text "Right of $PUPPET_CONF" --result OK --color GREEN
else
	Display --indent 4 --text "Right of $PUPPET_CONF" --result "$RESULTAT" --color RED --advice GLOBAL_FILE_CHMOD640
fi

FindValueOf "$PUPPET_CONF" request_header_max_size JUSTTEST
if [ -z "$RESULTAT" ]
then
	RESULTAT=20
fi
if [ "$RESULTAT" -le 20 ]
then
	Display --indent 4 --text "request_header_max_size <= 20kb" --result GOOD --color GREEN
else
	Display --indent 4 --text "request_header_max_size > 20kb" --result BAD --color ORANGE
fi
return 0;