diff --git a/files/auto/autopause-daemon.sh b/files/auto/autopause-daemon.sh index 3834b2e..6bb0233 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\"."