X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=system-status;h=0e63964a78c519d1e5c1f0462fed7848ecc9d290;hb=21bddd1d26a0349f3932f12c65fbc0775e855880;hp=6b25454468af35da3960ea2ae8ec5756047347ad;hpb=7f6a974222bd0f3936b61a8430d3e28a13307632;p=distro-setup diff --git a/system-status b/system-status index 6b25454..0e63964 100755 --- a/system-status +++ b/system-status @@ -13,7 +13,7 @@ if [[ $EUID != 1000 ]]; then exit 1 fi -source /a/bin/errhandle/err +source /a/bin/bash-bear-trap/bash-bear status_file=/dev/shm/iank-status shopt -s nullglob @@ -454,9 +454,14 @@ main-loop() { if $power; then if (( loop_count % 10 == 0 )); then - bat=$(cat /sys/class/power_supply/BAT0/capacity) + if [[ -r /sys/class/power_supply/BAT0/capacity ]]; then + bat=$(cat /sys/class/power_supply/BAT0/capacity) + else + bat=100 + fi case $bat in 100|9?) + : bitcoinon & ;; esac