mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
Fix(adduser): better binary check
This commit is contained in:
parent
8ceff21474
commit
70edfaf348
1 changed files with 2 additions and 2 deletions
|
@ -25,11 +25,11 @@ adduser() {
|
|||
chown ${@[$#]} $temp_installscript && chmod +x $temp_installscript
|
||||
|
||||
#try installing with sudo or su when not available
|
||||
if [[ -x $(which sudo) ]] ; then
|
||||
if [[ -x "$commands[sudo]" ]] ; then
|
||||
sudo -u ${@[$#]} $temp_installscript
|
||||
returncode=$?
|
||||
else
|
||||
if [[ -x $(which su) ]] ; then
|
||||
if [[ -x "$commands[su]" ]] ; then
|
||||
su -l ${@[$#]} -c $temp_installscript
|
||||
returncode=$?
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue