Megatest

Artifact [f0e3e0c4ea]
Login

Artifact f0e3e0c4ea0b63a4b7f4b649a497548948d72c79:


#!/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