154-nut.patch
eole/diagnose/module/154-nut | ||
---|---|---|
7 | 7 |
if [ "$activer_nut" = "oui" ] && [ "$nut_ups_daemon" = "oui" ]; then |
8 | 8 |
EchoGras "*** Onduleur" |
9 | 9 |
printf ". %${len_pf}s => " "Test de l'onduleur" |
10 |
status=`/bin/upsc $nut_ups_name@localhost ups.status` |
|
11 |
charge=`/bin/upsc $nut_ups_name@localhost battery.charge` |
|
12 |
#si OL dans le status |
|
13 |
for a in $status; do |
|
14 |
[ "$a" = "OL" ] && ok=true && break |
|
15 |
done |
|
16 | ||
17 |
if [ "$ok" = "true" ]; then |
|
18 |
EchoVert "OK ($charge %)" |
|
19 |
elif [ "$charge" -lt "20" ]; then |
|
20 |
EchoRouge "Charge batterie Faible ($charge %)" |
|
10 |
status=`/bin/upsc $nut_ups_name@localhost ups.status 2>&1` |
|
11 |
if [ $? -ne 0 ];then |
|
12 |
EchoRouge "$status" |
|
21 | 13 |
else |
22 |
EchoOrange "Fonctionnement sur batterie ($charge %)" |
|
14 |
charge=`/bin/upsc $nut_ups_name@localhost battery.charge` |
|
15 |
#si OL dans le status |
|
16 |
for a in $status; do |
|
17 |
[ "$a" = "OL" ] && ok=true && break |
|
18 |
done |
|
19 | ||
20 |
if [ "$ok" = "true" ]; then |
|
21 |
EchoVert "OK ($charge %)" |
|
22 |
elif [ "$charge" -lt "20" ]; then |
|
23 |
EchoRouge "Charge batterie Faible ($charge %)" |
|
24 |
else |
|
25 |
EchoOrange "Fonctionnement sur batterie ($charge %)" |
|
26 |
fi |
|
23 | 27 |
fi |
24 | 28 |
echo |
25 | 29 |
fi |