moved from $command/sudo $command to include "sudo" in the command variable
This commit is contained in:
parent
cdc17a329b
commit
3e22f4ebbd
7
pman.sh
7
pman.sh
@ -84,11 +84,12 @@ fi
|
||||
# If sudo is needed and necessary (and installed), prepend it, if not installed throw error
|
||||
if [ "$su_needed" = "true" ] && [ "$UID" != 0 ]; then
|
||||
if command -v "sudo" &>/dev/null; then
|
||||
sudo $command $command_args "${@}"
|
||||
command="sudo $command"
|
||||
else
|
||||
echo "sudo command needed but not found" > /dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
$command $command_args "${@}"
|
||||
fi
|
||||
|
||||
# Execute the command
|
||||
$command $command_args "${@}"
|
||||
|
Loading…
Reference in New Issue
Block a user