mirror of
https://github.com/linuxboot/heads.git
synced 2025-03-14 08:16:44 +00:00
functions: remove now unused calc helper, readd TRACE_FUNC and DEBUG info for future tracing and debug of now hackish bashisms.
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
This commit is contained in:
parent
6f2e7cbefa
commit
7ce3ac709f
@ -1190,9 +1190,6 @@ scan_boot_options() {
|
||||
fi
|
||||
}
|
||||
|
||||
calc() {
|
||||
awk "BEGIN { print "$*" }"
|
||||
}
|
||||
|
||||
# truncate a file to a size only if it is longer (busybox truncate lacks '<' and
|
||||
# always sets the file size)
|
||||
@ -1221,7 +1218,9 @@ fromhex_plain() {
|
||||
}
|
||||
|
||||
print_battery_state() {
|
||||
TRACE_FUNC
|
||||
battery="$1"
|
||||
DEBUG "Battery: $1"
|
||||
battery_charge=$(awk "BEGIN {printf \"%d\", ($(cat "${battery}/charge_now")/$(cat "${battery}/charge_full")*100)}")
|
||||
battery_health=$(awk "BEGIN {printf \"%d\", ($(cat "${battery}/charge_full")/$(cat "${battery}/charge_full_design")*100)}")
|
||||
echo "$(basename "${battery}") ${battery_charge} ${battery_health}"
|
||||
|
@ -164,6 +164,7 @@ file_selector() {
|
||||
}
|
||||
|
||||
show_system_info() {
|
||||
TRACE_FUNC
|
||||
battery_status=""
|
||||
for battery in /sys/class/power_supply/BAT*; do
|
||||
if [[ -d "${battery}" ]]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user