Update tuto 3

This commit is contained in:
nemunaire 2019-10-22 18:03:09 +02:00
commit beb834c01c
9 changed files with 1890 additions and 44 deletions

46
tutorial/3/check.sh Executable file
View file

@ -0,0 +1,46 @@
#!/bin/sh
note_init() {
NOTE=0
echo -n $@
}
note() {
NOTE=$(($NOTE + $1))
echo -n ,$@
}
for LOGIN in $@
do
note_init $LOGIN
if [ -f "$LOGIN" ]; then
QUESTIONSF="$LOGIN"
else
QUESTIONSF="$LOGIN/questions.txt"
fi
# Questions
if grep -E -i "(grsec)" "${QUESTIONSF}" 2> /dev/null > /dev/null; then
note 1
else
note 0
fi
if grep -E -i "(/proc/.*/oom_|score)" "${QUESTIONSF}" 2> /dev/null > /dev/null; then
note 1
else
note 0
fi
if grep -E -i "root" "${QUESTIONSF}" 2> /dev/null > /dev/null; then
note 1
else
note 0
fi
echo #" = $NOTE"
done