Updated scripts to use new shell functions
This commit is contained in:
parent
745f13e4c3
commit
d40f66a409
5 changed files with 6 additions and 26 deletions
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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__":
|
||||
|
|
|
|||
|
|
@ -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__":
|
||||
|
|
|
|||
|
|
@ -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__":
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ Pin: version {}
|
|||
Pin-Priority:999
|
||||
|
||||
""".format(package, version))
|
||||
shell.prompt_reboot()
|
||||
|
||||
# Main function
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Reference in a new issue