iankelling.org
/
git
/
distro-setup
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
various fixes
[distro-setup]
/
system-status
diff --git
a/system-status
b/system-status
index 28b302441684782b49f838b50512b6c13912eca9..6b25454468af35da3960ea2ae8ec5756047347ad 100755
(executable)
--- a/
system-status
+++ b/
system-status
@@
-443,6
+443,7
@@
if [[ $1 ]]; then
exit 0
fi
exit 0
fi
+loop_count=0
main-loop() {
while true; do
power=true
main-loop() {
while true; do
power=true
@@
-450,16
+451,25
@@
main-loop() {
power=false
fi
wait=15
power=false
fi
wait=15
- if ! $power; then
- if systemctl -q is-active bitcoind; then
- bitcoinoff
+
+ if $power; then
+ if (( loop_count % 10 == 0 )); then
+ bat=$(cat /sys/class/power_supply/BAT0/capacity)
+ case $bat in
+ 100|9?)
+ bitcoinon &
+ ;;
+ esac
fi
fi
+ else
+ bitcoinoff
wait=60
fi
sleep $wait
write-status
mute
wait=60
fi
sleep $wait
write-status
mute
+ loop_count=$(( loop_count + 1 ))
done
}
done
}