Added test for sysctl path

This commit is contained in:
Jaggzh 2021-12-26 19:20:05 -08:00 committed by supermerill
parent c6560508d7
commit 83ec3d7e00

View File

@ -1,7 +1,13 @@
#!/bin/bash
# Our sysctl call may be run as normal user,
# but /sbin is not always in normal users' PATH.
if [[ -f /sbin/sysctl && -x /sbin/sysctl ]]; then sysctl_bin=/sbin/sysctl
else sysctl_bin=sysctl # If not found in sbin, hope
fi
export ROOT=`pwd`
export NCORES=`sysctl -n hw.ncpu`
export NCORES=`"$sysctl_bin" -n hw.ncpu`
while getopts ":ih" opt; do
case ${opt} in