Incorrect sudo permission judgment logic

Reason: command -v sudo only determines whether the command exists, not whether sudo is available.
This commit is contained in:
neonmike
2025-09-17 08:40:35 -04:00
parent 0322eba62f
commit 6108ee278d

View File

@@ -24,7 +24,7 @@ upgrade_bash() {
else
if [ -f /etc/os-release ]; then
. /etc/os-release
if [ $(id -u) -ne 0 ] && ! command -v sudo >/dev/null 2>&1; then
if [ $(id -u) -ne 0 ] && ! sudo -v >/dev/null 2>&1; then
echo "Error: You need sudo privileges to upgrade Bash."
exit 1
fi