File utils/nbfind artifact f0e3e0c4ea part of check-in 4cf18277f3
#!/bin/bash -ex # load=`uptime|awk '{print $10}'|cut -d, -f1` load=`uptime|perl -pe 's/.*: (\d+.\d+),.*/$1/'` if which cpucheck > /dev/null;then numcpu=`cpucheck|tail -1|awk '{print $6}'` else numcpu=`lscpu|grep "CPU.s.:"|awk '{print $2}'` fi lperc=`echo "100 * $load / $numcpu"|bc` if [[ $lperc -lt 100 ]];then # echo "Load percent: $lperc < 100, using nbfake" nbfake "$@" # $(*) else # echo "Load percent: $lperc > 100, using NBLAUNCHER" $NBLAUNCHER "$@" fi