fix elevation issues and absence of /sbin in the PATH

This commit is contained in:
bol-van 2022-03-27 18:58:47 +03:00
parent 479ba87fc5
commit f16e72974c
4 changed files with 12 additions and 2 deletions

View File

@ -996,10 +996,10 @@ sigpipe()
exit 1
}
fix_sbin_path
check_system
check_prerequisites
require_root
check_prerequisites
check_dns
ask_params

View File

@ -174,3 +174,11 @@ call_for_multiple_items()
done
eval $2=\"$items\"
}
fix_sbin_path()
{
local IFS=':'
printf "%s\n" $PATH | grep -Fxq '/usr/sbin' || PATH="/usr/sbin:$PATH"
printf "%s\n" $PATH | grep -Fxq '/sbin' || PATH="/sbin:$PATH"
export PATH
}

View File

@ -979,6 +979,7 @@ install_macos()
# build binaries, do not use precompiled
[ "$1" = "make" ] && FORCE_BUILD=1
fix_sbin_path
check_system
[ "$SYSTEM" = "macos" ] && . "$EXEDIR/init.d/macos/functions"

View File

@ -73,6 +73,7 @@ remove_macos()
}
fix_sbin_path
check_system
require_root