From 8bc6853b6c7590f85af34a363d5263fe0c1e5767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Mon, 28 May 2018 17:00:21 +0200 Subject: [PATCH] No exit with error if don't find sudoers line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way, actions can be done with the result (eg. add the line,…). --- client/fix_backuppc_linux_sudo.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/fix_backuppc_linux_sudo.sh b/client/fix_backuppc_linux_sudo.sh index 713511e..58e12f6 100755 --- a/client/fix_backuppc_linux_sudo.sh +++ b/client/fix_backuppc_linux_sudo.sh @@ -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 } ## ]]]