Δημοσιεύτηκε: 15 Μάιος 2013, 10:56
από lepidas
the_eye έγραψε:Για τα apc ups υπάρχει λογισμικό. Αλλά εγώ θα έκανα κάτι ποιο γενικό πχ
Ένα cronjob που θα ελένχει ανά 5 λεπτά το παρακάτω.
Κώδικας: Επιλογή όλων
upower -d | grep on-low-battery | awk '{print $2}'

και αν βγει yes τότε θα κάνει shutdown.

Για τρέξε
Κώδικας: Επιλογή όλων
upower -d
έδωσε NO σε όλα παρ'ολο που το αναγνώρισε EDIT: οκ εδειξε YES μετά απο λίγο
Κώδικας: Επιλογή όλων
blades@ubuntu-distrato:~$ upower -d
Device: /org/freedesktop/UPower/devices/ups_hiddev0
native-path: /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/1-1.3:1.0/usb/hiddev0
power supply: yes
updated: Wed May 15 10:55:04 2013 (19 seconds ago)
has history: yes
has statistics: yes
ups
present: yes
state: charging
time to empty: 43.1 minutes
percentage: 67%

Daemon:
daemon-version: 0.9.15
can-suspend: no
can-hibernate no
on-battery: no
on-low-battery: no
lid-is-closed: no
lid-is-present: no
is-docked: no


Κώδικας: Επιλογή όλων
blades@ubuntu-distrato:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 051d:0002 American Power Conversion Uninterruptible Power Supply