Skip to content

Commit 94c8a86

Browse files
authored
Apply SKIP_SUDO when starting knockd (#2795)
1 parent 1d57487 commit 94c8a86

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

files/auto/autopause-daemon.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ if isTrue "${DEBUG_AUTOPAUSE}"; then
4545
knockdArgs+=(-D)
4646
fi
4747

48-
sudo /usr/local/sbin/knockd "${knockdArgs[@]}"
48+
if isTrue "${SKIP_SUDO}"; then
49+
/usr/local/sbin/knockd "${knockdArgs[@]}"
50+
else
51+
sudo /usr/local/sbin/knockd "${knockdArgs[@]}"
52+
fi
53+
4954
if [ $? -ne 0 ] ; then
5055
logAutopause "Failed to start knockd daemon."
5156
logAutopause "Probable cause: Unable to attach to interface \"$AUTOPAUSE_KNOCK_INTERFACE\"."

0 commit comments

Comments
 (0)