Fixed /nice' display breaking the actual maths!
This commit is contained in:
parent
64ac879faa
commit
80eaa5ee9a
14
avail.sh
14
avail.sh
|
@ -65,11 +65,7 @@ if [[ $mode == "s" ]]; then
|
|||
diagram="${diagram}[server]\n"
|
||||
eq="${eq} * 100"
|
||||
answer=$(echo "scale=9; $eq" | bc)
|
||||
if [[ $answer == 99.* ]]; then
|
||||
answershort=$(echo "$answer" | tr -dc '9.')
|
||||
else
|
||||
answershort=$answer
|
||||
fi
|
||||
answershort=$(echo "$answer" | sed 's/\(\.[^0]\+\)0\+/\1/')
|
||||
if [[ $answershort == 99.* ]]; then
|
||||
nines=$(echo $answershort | tr -d -C 9 | wc -c | tr -d ' ')
|
||||
[[ $nines -eq 1 ]] && ess="" || ess="s"
|
||||
|
@ -190,11 +186,7 @@ elif [[ $mode == "p" ]]; then
|
|||
|
||||
eq="(1 - (1 - (${sysuptime}/100))^${nsites})*100"
|
||||
answer=$(echo "scale=15; $eq" | bc)
|
||||
if [[ $answer == 99.* ]]; then
|
||||
answershort=$(echo "$answer" | tr -dc '9.')
|
||||
else
|
||||
answershort=$answer
|
||||
fi
|
||||
answershort=$(echo "$answer" | sed 's/\(\.[^0]\+\)0\+/\1/')
|
||||
if [[ $answershort == 99.* ]]; then
|
||||
nines=$(echo $answershort | tr -d -C 9 | wc -c | tr -d ' ')
|
||||
[[ $nines -eq 1 ]] && ess="" || ess="s"
|
||||
|
@ -214,7 +206,7 @@ elif [[ $mode == "p" ]]; then
|
|||
echo
|
||||
csecho -e "$WHITE" "^b${UNDERLINE}Availability^p\n"
|
||||
inform "^bEquation:^p ${eq}"
|
||||
inform "^bAvailability:^p ${answershort}% $ninestext)"
|
||||
inform "^bAvailability:^p ${answershort}% $ninestext"
|
||||
else
|
||||
echo "Architecture"
|
||||
echo "------------"
|
||||
|
|
Loading…
Reference in New Issue