This commit adds the ability to safely shutdown or restart the Raspberry Pi
from the web interface, with proper sudo permissions and user confirmations.
Features:
- API endpoints for /api/system/shutdown and /api/system/restart
- System Control card in UI with shutdown and restart buttons
- JavaScript confirmation dialogs to prevent accidental shutdowns
- Shutdown has 1-minute delay, restart is immediate
- Auto-reload after restart (30 second delay)
- Sudoers file for passwordless sudo commands
Technical details:
- Uses subprocess.Popen() for non-blocking command execution
- Shutdown: 'sudo shutdown -h +1' (1 minute delay)
- Restart: 'sudo reboot' (immediate)
- Created wedding-phone-shutdown sudoers file
- Template version updated to 1.9.0
Installation required:
sudo cp wedding-phone-shutdown /etc/sudoers.d/wedding-phone-shutdown
sudo chmod 0440 /etc/sudoers.d/wedding-phone-shutdown
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>