mirror of
https://github.com/kforney/pentest-distro-builder.git
synced 2025-02-09 17:37:16 -07:00
Former-commit-id: 09eacc3f3f761c2b3454d20356ba085d18bdb722 Former-commit-id: 89d8a1302bd2a72239fbe9ad9820be4ecda76cab
27 lines
467 B
Bash
Executable file
27 lines
467 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
source "$CURRENT_DIR/helpers.sh"
|
|
|
|
print_graph() {
|
|
if [ -z "$1" ]; then
|
|
echo ""
|
|
elif [ "$1" -lt "20" ]; then
|
|
echo "▁"
|
|
elif [ "$1" -lt "40" ]; then
|
|
echo "▂"
|
|
elif [ "$1" -lt "60" ]; then
|
|
echo "▃"
|
|
elif [ "$1" -lt "80" ]; then
|
|
echo "▅"
|
|
else
|
|
echo "▇"
|
|
fi
|
|
}
|
|
|
|
main() {
|
|
local percentage=$($CURRENT_DIR/battery_percentage.sh)
|
|
print_graph ${percentage%?}
|
|
}
|
|
main
|