No exit with error if don't find sudoers line

This way, actions can be done with the result (eg. add the line,…).
This commit is contained in:
Jeremy Gardais 2018-05-28 17:00:21 +02:00
parent 4123be0626
commit 8bc6853b6c
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 2 additions and 3 deletions

View File

@ -29,7 +29,6 @@ is_user() ## [[[
fi
}
## ]]]
is_sudoers_line() ## [[[
{
line_to_check="${1}"
@ -39,8 +38,8 @@ is_sudoers_line() ## [[[
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG: ${line_to_check} line is available in sudo configuration."
return "${SUCCESS}"
else
printf '\e[1;31m%-6s\e[m\n' "ERROR: ${line_to_check} was not found in sudo configuration."
exit "${ERROR}"
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG: ${line_to_check} was not found in sudo configuration."
return "${ERROR}"
fi
}
## ]]]