Skip to content

Commit 9e608f2

Browse files
authored
Raspi-leds failsafe
1 parent 89c8498 commit 9e608f2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

PC_Miner.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ def handler(signal_received, frame):
5757
+ Fore.RESET
5858
+ get_string("goodbye"),
5959
"warning")
60-
60+
61+
if not "raspi_leds" in user_settings:
62+
user_settings["raspi_leds"] = "y"
63+
6164
if running_on_rpi and user_settings["raspi_leds"] == "y":
6265
# Reset onboard status LEDs
6366
os.system(
@@ -599,7 +602,10 @@ def _blink_builtin(led="green"):
599602
sleep(0.1)
600603
os.system(
601604
'echo 0 | sudo tee /sys/class/leds/led1/brightness >/dev/null 2>&1')
602-
605+
606+
if not "raspi_leds" in user_settings:
607+
user_settings["raspi_leds"] = "y"
608+
603609
if type == "accept":
604610
if running_on_rpi and user_settings["raspi_leds"] == "y":
605611
_blink_builtin()
@@ -1300,7 +1306,10 @@ def load():
13001306

13011307
Fasthash.load()
13021308
Fasthash.init()
1303-
1309+
1310+
if not "raspi_leds" in user_settings:
1311+
user_settings["raspi_leds"] = "y"
1312+
13041313
if user_settings["raspi_leds"] == "y":
13051314
try:
13061315
with io.open('/sys/firmware/devicetree/base/model', 'r') as m:

0 commit comments

Comments
 (0)