Merge pull request #165 from makermelissa/master

Updated scripts to use new shell functions
This commit is contained in:
Melissa LeBlanc-Williams 2021-03-03 13:45:40 -08:00 committed by GitHub
commit f8564631a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 26 deletions

View file

@ -51,13 +51,7 @@ Run time < 1 minute. Reboot not required.""")
shell.info('Enabling Raspberry Pi Fan Service on GPIO 4')
shell.run_command("sudo raspi-config nonint do_fan 0 4")
shell.info('Done!')
if not shell.prompt("REBOOT NOW?", default="y"):
print("Exiting without reboot.")
shell.exit()
print("Reboot started...")
os.sync()
shell.reboot()
shell.exit()
shell.prompt_reboot()
else:
shell.info('Adding adafruit_fan.service')
contents = """[Unit]

View file

@ -59,12 +59,7 @@ Installing...""")
Settings take effect on next boot.
""")
if not shell.prompt("REBOOT NOW?", default="n"):
print("Exiting without reboot.")
shell.exit()
print("Reboot started...")
shell.reboot()
shell.exit()
shell.prompt_reboot()
# Main function
if __name__ == "__main__":

View file

@ -106,12 +106,7 @@ Updating package index files...""")
Settings take effect on next boot.
""")
if not shell.prompt("REBOOT NOW?", default="n"):
print("Exiting without reboot.")
shell.exit()
print("Reboot started...")
shell.reboot()
shell.exit()
shell.prompt_reboot()
# Main function
if __name__ == "__main__":

View file

@ -78,6 +78,7 @@ Raspberry Pi and installs Blinka
shell.bail("Sorry. This script currently only runs on Raspberry Pi OS.")
if not shell.is_python3():
shell.bail("You must be running Python 3. Older versions have now been deprecated.")
shell.check_kernel_update_reboot_required()
if default_python_version() < 3:
shell.warn("WARNING Default System python version is {}. It will be updated to Version 3.".format(default_python_version(False)))
default_python = 2
@ -94,13 +95,7 @@ Raspberry Pi and installs Blinka
Settings take effect on next boot.
""")
if not shell.prompt("REBOOT NOW?", default="y"):
print("Exiting without reboot.")
shell.exit()
print("Reboot started...")
os.sync()
shell.reboot()
shell.exit()
shell.prompt_reboot()
# Main function
if __name__ == "__main__":

View file

@ -52,6 +52,7 @@ Pin: version {}
Pin-Priority:999
""".format(package, version))
shell.prompt_reboot()
# Main function
if __name__ == "__main__":