Skip to content

Commit 0846085

Browse files
committed
better regex for sudo
to close #47
1 parent 234d558 commit 0846085

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deb/update-nodejs-and-nodered

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ if [ "$EUID" == "0" ]; then
196196
SUDOE=''
197197
id -u nobody &>/dev/null || adduser --no-create-home --shell /dev/null --disabled-password --disabled-login --gecos '' nobody &>/dev/null
198198
else
199-
groups "$USER" | grep -q ' sudo' && GRS="Y" || GRS="N"
199+
groups "$USER" | grep -q '^.*\bsudo\b.*' && GRS="Y" || GRS="N"
200200
if [[ "$GRS" == "N" ]]; then
201201
echo "User $NODERED_USER not in sudoers group. Exiting"
202202
exit 1;

0 commit comments

Comments
 (0)