From 6d52d178bb255361f6df186d51a669b1b0b4b7cb Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Thu, 27 Aug 2020 14:56:30 -0700 Subject: [PATCH] Added reboot and file append is better --- adafruit_shell.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/adafruit_shell.py b/adafruit_shell.py index 39e8fb2..2b5648f 100644 --- a/adafruit_shell.py +++ b/adafruit_shell.py @@ -135,6 +135,13 @@ class Shell: """ os.system("clear") + @staticmethod + def reboot(): + """ + Reboot the system + """ + os.system("reboot") + @staticmethod def is_root(): """ @@ -158,6 +165,7 @@ class Shell: """ if append: mode = "a" + content = "\n" + content else: mode = "w" service_file = open(path, mode)