Change statepipe read method

This commit is contained in:
Joshua Boniface 2017-03-31 05:03:39 +00:00
parent 0ffe48e080
commit f20a9ca37b
1 changed files with 2 additions and 2 deletions

4
bmc.sh
View File

@ -76,8 +76,8 @@ locate_off() {
echo "locate_off" > ${bmcd_cmdpipe} echo "locate_off" > ${bmcd_cmdpipe}
} }
readpower() { readpower() {
powerstate_raw=$(echo < ${bmcd_statepipe}) powerstate_raw=$(cat ${bmcd_statepipe})
if [ "${powerstate_raw}" -eq 1 ]; then if [[ "${powerstate_raw}" -eq 1 ]]; then
powerstate="\e[32mOn\e[0m" powerstate="\e[32mOn\e[0m"
else else
powerstate="\e[31mOff\e[0m" powerstate="\e[31mOff\e[0m"