mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-22 05:27:01 +01:00
parent
cbd81b8ab2
commit
d110a2aa19
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^$SSH_PARAM"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^$SSH_PARAM"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file $FILE "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase $FILE "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -34,7 +34,7 @@ audit() {
|
||||
# shellcheck disable=SC2001
|
||||
SSH_VALUE=$(sed "s/'//g" <<<"$SSH_VALUE")
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -59,12 +59,12 @@ apply() {
|
||||
# shellcheck disable=SC2001
|
||||
SSH_VALUE=$(sed "s/'//g" <<<"$SSH_VALUE")
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file $FILE "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase $FILE "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file $FILE "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase $FILE "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file $FILE "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase $FILE "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file $FILE "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase $FILE "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -61,7 +61,7 @@ apply() {
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ audit() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
@ -55,12 +55,12 @@ apply() {
|
||||
SSH_PARAM=$(echo "$SSH_OPTION" | cut -d= -f 1)
|
||||
SSH_VALUE=$(echo "$SSH_OPTION" | cut -d= -f 2)
|
||||
PATTERN="^${SSH_PARAM}[[:space:]]*$SSH_VALUE"
|
||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "$PATTERN"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$PATTERN is present in $FILE"
|
||||
else
|
||||
warn "$PATTERN is not present in $FILE, adding it"
|
||||
does_pattern_exist_in_file "$FILE" "^${SSH_PARAM}"
|
||||
does_pattern_exist_in_file_nocase "$FILE" "^${SSH_PARAM}"
|
||||
if [ "$FNRET" != 0 ]; then
|
||||
add_end_of_file "$FILE" "$SSH_PARAM $SSH_VALUE"
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user