We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 82deb93 + 073b68e commit 15a19faCopy full SHA for 15a19fa
adafruit_shell.py
@@ -490,6 +490,22 @@ def get_raspbian_version(self):
490
return raspbian
491
return None
492
493
+ def prompt_reboot(self):
494
+ """Prompt the user for a reboot"""
495
+ if not self.prompt("REBOOT NOW?", default="y"):
496
+ print("Exiting without reboot.")
497
+ else:
498
+ print("Reboot started...")
499
+ os.sync()
500
+ self.reboot()
501
+ self.exit()
502
+
503
+ def check_kernel_update_reboot_required(self):
504
+ """Checks if the pi needs to be rebooted since the last kernel update"""
505
+ if not self.exists("/lib/modules/{}".format(self.release())):
506
+ self.error("OS has not been rebooted since last kernel update.")
507
+ self.prompt_reboot()
508
509
# pylint: enable=invalid-name
510
511
@staticmethod
0 commit comments