| Rev 4745 | Rev 4784 | ||
|---|---|---|---|
| Line 16... | Line 16... | ||
| 16 | while True: |
16 | while True: |
| 17 | stav = gpio.digitalRead(power_sense_pin) |
17 | stav = gpio.digitalRead(power_sense_pin) |
| 18 | |
18 | |
| 19 | if oldstav == 0 and stav == 0: |
19 | if oldstav == 0 and stav == 0: |
| 20 | subprocess.call("shutdown -P 0", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
20 | subprocess.call("shutdown -P 0", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| - | 21 | exit(0) |
|
| 21 | else: |
22 | else: |
| 22 | print "power is OK." |
23 | print "power is OK." |
| 23 | |
24 | |
| 24 | oldstav = stav |
25 | oldstav = stav |
| 25 | |
26 | |