Merci Nicosss pour ta patience.
Tout me semble correct, sauf la variable “maxretry=3” qui ne figure pas sur la documentation. Dois je la retirer ?
Voici les résultats:
$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 413c:2111 Dell Computer Corp. [unknown]
Bus 001 Device 003: ID 046d:0824 Logitech, Inc. [unknown]
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 0461:4e22 Primax Electronics, Ltd Dell Mouse, 2 Buttons, Modell: MS111-P
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 002: ID 0463:ffff MGE UPS Systems UPS
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
# grep ^MODE /etc/ups/nut.conf
MODE=standalone
# grep -v '^#' /etc/ups/ups.conf
maxretry = 3
[eaton3s]
driver = usbhid-ups
port = auto
# grep -v '^#' /etc/ups/upsmon.conf | egrep -v '^$'
MONITOR eaton3s@localhost 1 monuser pass master
MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h +0"
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG /etc/killpower
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC
NOTIFYCMD "/etc/ups/shutdown-script"
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 5
# grep -v '^#' /etc/ups/upsd.users | egrep -v '^$'
[*******]
password=******
upsmon master
# cat /etc/ups/shutdown-script
\#!/bin/bash
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin
trap "exit 0" SIGTERM
notify() {
notify-send -u $2 "$0: $1"
}
if [ "$NOTIFYTYPE" = "ONLINE" ]; then
notify "power restored" critical
killall -s SIGTERM `basename $0`
fi
if [ "$NOTIFYTYPE" = "ONBATT" ]; then
notify "3 minutes until shutdown" critical
let "n = 18"
while [ $n -ne 0 ]
do
sleep 10
let "n--"
notify "$(( $n \* 10 )) seconds until to shutdown" low
done
notify "commencing shutdown" critical
upsmon -c fsd
fi
#
a+
pll
Edit Nicosss : Correction balises Markdown + Séparation blocs -> Voir FAQ