diff --git a/system-info/system-info-WSL.sh b/system-info/system-info-WSL.sh index 8274d83..d42f3aa 100755 --- a/system-info/system-info-WSL.sh +++ b/system-info/system-info-WSL.sh @@ -31,7 +31,9 @@ while true; do raw_battery=$(powershell.exe -NoProfile \ "(Get-WmiObject win32_battery).EstimatedChargeRemaining" \ | sed 's/\r//') - battery=$(printf "%3d%%" "$raw_battery") + if [ "" != "$raw_battery" ]; then + battery=$(printf "%3d%%" "$raw_battery") + fi echo "$cpu_temp$cpu_load$battery" > $cache_file # echo -e "HTTP/1.1 200 OK\n\n$cpu_temp $cpu_load" | nc -l -k -p 8080 -q 1;