From 94c8a86c7c664a49edec25970a8f9a8b7a2446e4 Mon Sep 17 00:00:00 2001 From: Anton Curanz Date: Fri, 26 Apr 2024 23:09:19 +0200 Subject: [PATCH] Apply SKIP_SUDO when starting knockd (#2795) --- files/auto/autopause-daemon.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/files/auto/autopause-daemon.sh b/files/auto/autopause-daemon.sh index 3834b2e6..6bb02331 100644 --- a/files/auto/autopause-daemon.sh +++ b/files/auto/autopause-daemon.sh @@ -45,7 +45,12 @@ if isTrue "${DEBUG_AUTOPAUSE}"; then knockdArgs+=(-D) fi -sudo /usr/local/sbin/knockd "${knockdArgs[@]}" +if isTrue "${SKIP_SUDO}"; then + /usr/local/sbin/knockd "${knockdArgs[@]}" +else + sudo /usr/local/sbin/knockd "${knockdArgs[@]}" +fi + if [ $? -ne 0 ] ; then logAutopause "Failed to start knockd daemon." logAutopause "Probable cause: Unable to attach to interface \"$AUTOPAUSE_KNOCK_INTERFACE\"."