Fix(adduser): better binary check

This commit is contained in:
Nikolas Garofil 2021-12-22 19:16:50 +01:00
parent 8ceff21474
commit 70edfaf348

View file

@ -25,11 +25,11 @@ adduser() {
chown ${@[$#]} $temp_installscript && chmod +x $temp_installscript chown ${@[$#]} $temp_installscript && chmod +x $temp_installscript
#try installing with sudo or su when not available #try installing with sudo or su when not available
if [[ -x $(which sudo) ]] ; then if [[ -x "$commands[sudo]" ]] ; then
sudo -u ${@[$#]} $temp_installscript sudo -u ${@[$#]} $temp_installscript
returncode=$? returncode=$?
else else
if [[ -x $(which su) ]] ; then if [[ -x "$commands[su]" ]] ; then
su -l ${@[$#]} -c $temp_installscript su -l ${@[$#]} -c $temp_installscript
returncode=$? returncode=$?
else else