Add update_system.py script for package management and reboot handling

This commit is contained in:
2025-10-06 10:13:29 -04:00
parent 95f132bdf8
commit 9f112e0903
2 changed files with 47 additions and 0 deletions
@@ -0,0 +1,15 @@
#!/usr/bin/python3
import subprocess
import os
# Update package lists
subprocess.run(['sudo', 'apt', 'update'], check=True)
# Upgrade packages
subprocess.run(['sudo', 'apt', 'upgrade', '-y'], check=True)
# Check if reboot is required
if os.path.exists('/var/run/reboot-required'):
print("Reboot required. Rebooting now...")
subprocess.run(['sudo', 'reboot'])
else:
print("No reboot required.")