mirror of
https://github.com/kforney/pentest-distro-builder.git
synced 2024-05-17 16:04:51 -06:00
Kaj Forney
a6d12f1ffc
Former-commit-id: 7bddceacd727c25153cd0ec03cf8b0d4011484d5 Former-commit-id: aaf57e63c1976b3960fee717c68c3b09dc1a94ff
28 lines
467 B
Bash
Executable file
28 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
|