splitting the sudo check script

The sudo command check script is split to check permissions correctly
This commit is contained in:
lunardunno 2024-12-09 08:51:55 +04:00 committed by GitHub
parent 2b85dafa15
commit 055c8f7b66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,3 +1,3 @@
CUR_USER=$(whoami 2> /dev/null || echo ~ | sed 's/.*\///');\
echo $LANG | grep -qE "en_US.UTF-8|^C.UTF-8" || export LC_ALL=C;\
[ "$CUR_USER" = "root" ] || groups $CUR_USER | grep -E "\<sudo\>|\<wheel\>" && sudo -nu $CUR_USER sudo -n uname > /dev/null
[ "$CUR_USER" = "root" ] || groups $CUR_USER | grep -E "\<sudo\>|\<wheel\>" && sudo -nu $CUR_USER uname > /dev/null && sudo -n uname > /dev/null