This commit is contained in:
Santiago Lo Coco 2021-12-30 14:58:11 -03:00
parent 40137ed07c
commit ab514210d2
1 changed files with 12 additions and 4 deletions

View File

@ -205,9 +205,13 @@ networkConf() {
calcWidthAndRun() {
width=$(echo "$@" | grep -oP '(?<=").*?(?=")' | wc -c)
toReturn=$(eval $(echo "$@" | sed "s/WIDTH/$((${width}+8))/g"))
comm=$(echo "$@" | sed "s/WIDTH/$((${width}+8))/g")
if [[ $comm != *"3>&1 1>&2 2>&3" ]]; then
comm="${comm} 3>&1 1>&2 2>&3"
fi
commOutput=$(eval $comm)
exitStatus=$?
echo $toReturn
[ ! -z $commOutput ] && echo $commOutput
return $exitStatus
}
@ -219,9 +223,13 @@ calcHeightAndRun() {
x = (($1 - $2 + ($2 * 60)) / 60)
printf "%d", (x == int(x)) ? x : int(x) + 1
}')
toReturn=$(eval $(echo "$@" | sed "s/HEIGHT/$((5+$height))/g"))
comm=$(echo "$@" | sed "s/HEIGHT/$((5+$height))/g")
if [[ $comm != *"3>&1 1>&2 2>&3" ]]; then
toRun="${comm} 3>&1 1>&2 2>&3"
fi
commOutput=$(eval $comm)
exitStatus=$?
echo $toReturn
[ ! -z $commOutput ] && echo $commOutput
return $exitStatus
}