Update power.inc.sh

This commit is contained in:
2024-01-12 19:24:09 -06:00
parent c988bebb62
commit 57c4923804

View File

@@ -869,12 +869,13 @@ PDUCONTROL(){
read -rd '' -a PORT_POWER <<<"${PORT_POWER}"
unset IFS
p=1
for port in "${!PORT_DESC[@]}"; do
p=$(expr ${port} + 1)
for p in "${!PORT_DESC[@]}"; do
port=$(expr ${p} + 1)
[ ${PORT_POWER[${p}]} -eq 1 ] && portpower_disp="${idsCL[Green]}ON" || portpower_disp="${idsCL[LightRed]}OFF"
[ ${p} -lt 10 ] && pp=" ${p}" || pp=${p}
[ ${port} -lt 10 ] && pp=" ${port}" || pp=${port}
# c=0; spc=''; spc1=`expr 28 - ${#port}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
spc=" "
echo -e "${pp}) ${idsCL[LightCyan]}${PORT_DESC[${p}]}${spc}${idsCL[Default]}: ${portpower_disp}${idsCL[Default]}"
# ((p++))
done
echo -e ""