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>
9 lines
412 B
Plaintext
9 lines
412 B
Plaintext
# Allow wedding-phone user to shutdown and reboot without password
|
|
# Copy this file to /etc/sudoers.d/wedding-phone-shutdown
|
|
# Usage: sudo cp wedding-phone-shutdown /etc/sudoers.d/wedding-phone-shutdown
|
|
# Then: sudo chmod 0440 /etc/sudoers.d/wedding-phone-shutdown
|
|
|
|
# Allow user to run shutdown and reboot commands without password
|
|
berwn ALL=(ALL) NOPASSWD: /sbin/shutdown
|
|
berwn ALL=(ALL) NOPASSWD: /sbin/reboot
|