Révision 0ab4b3a0
battery_: make a wildcard plugin
| plugins/sensors/battery_ | ||
|---|---|---|
| 1 | 1 |
#! /bin/sh |
| 2 | 2 |
# Plugin to monitor the battery status via the uevent API |
| 3 |
# |
|
| 4 |
# (c) 2015 - GPLv2 - steve.schnepp@pwkf.org |
|
| 5 |
# |
|
| 6 |
# It is a wildcard plugin, symlink it with the battery directory |
|
| 7 |
# default is to display charge as mAh, but you can also use percentage if you |
|
| 8 |
# prefer, by setting the env var "percent" to "yes". |
|
| 9 |
# |
|
| 10 |
# [battery_*] |
|
| 11 |
# env.percent no |
|
| 12 |
# |
|
| 3 | 13 |
|
| 4 |
battery_name=CMB1
|
|
| 5 |
percent=yes
|
|
| 14 |
battery_name=${0##*_}
|
|
| 15 |
percent=${percent:-"no"}
|
|
| 6 | 16 |
|
| 7 | 17 |
if [ "$1" = "config" ] |
| 8 | 18 |
then |
Formats disponibles : Unified diff